From 28c5a5b790a641d9e25604cf09d31222493d3b2e Mon Sep 17 00:00:00 2001 From: Martin Date: Mon, 9 Oct 2023 16:34:22 +0200 Subject: [PATCH] correctif(deploy): separe les migration d'ajout de colonne et de reference --- db/migrate/20231009070354_add_context_to_exports.rb | 5 +---- ...20231009143331_add_reference_to_exports_instructeur.rb | 8 ++++++++ db/schema.rb | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-) create mode 100644 db/migrate/20231009143331_add_reference_to_exports_instructeur.rb diff --git a/db/migrate/20231009070354_add_context_to_exports.rb b/db/migrate/20231009070354_add_context_to_exports.rb index d1e2d1f81..e79177b91 100644 --- a/db/migrate/20231009070354_add_context_to_exports.rb +++ b/db/migrate/20231009070354_add_context_to_exports.rb @@ -2,10 +2,7 @@ class AddContextToExports < ActiveRecord::Migration[7.0] disable_ddl_transaction! def change - safety_assured do - add_reference :exports, :instructeur, foreign_key: true, null: true, default: nil, index: { algorithm: :concurrently } - end - add_column :exports, :dossiers_count, :integer, null: true, default: nil end end + diff --git a/db/migrate/20231009143331_add_reference_to_exports_instructeur.rb b/db/migrate/20231009143331_add_reference_to_exports_instructeur.rb new file mode 100644 index 000000000..def26b04c --- /dev/null +++ b/db/migrate/20231009143331_add_reference_to_exports_instructeur.rb @@ -0,0 +1,8 @@ +class AddReferenceToExportsInstructeur < ActiveRecord::Migration[7.0] + disable_ddl_transaction! + def change + safety_assured do + add_reference :exports, :instructeur, foreign_key: true, null: true, default: nil, index: { algorithm: :concurrently } + end + end +end diff --git a/db/schema.rb b/db/schema.rb index 3d2d67f3b..832359bc4 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.0].define(version: 2023_10_09_070354) do +ActiveRecord::Schema[7.0].define(version: 2023_10_09_143331) do # These are extensions that must be enabled in order to support this database enable_extension "pgcrypto" enable_extension "plpgsql"