From cdbaf987c08303d02eddfed139adb04d80960df8 Mon Sep 17 00:00:00 2001 From: Eric Leroy-Terquem Date: Tue, 1 Aug 2023 16:21:13 +0200 Subject: [PATCH 1/2] db(routing): remove migrated champ routage columns --- app/models/dossier.rb | 2 -- app/models/procedure.rb | 3 +-- app/models/procedure_revision.rb | 1 - ...20230801121131_remove_migrated_champ_routage_columns.rb | 7 +++++++ 4 files changed, 8 insertions(+), 5 deletions(-) create mode 100644 db/migrate/20230801121131_remove_migrated_champ_routage_columns.rb diff --git a/app/models/dossier.rb b/app/models/dossier.rb index 8714a834378..230250e2889 100644 --- a/app/models/dossier.rb +++ b/app/models/dossier.rb @@ -58,8 +58,6 @@ class Dossier < ApplicationRecord include DossierSearchableConcern include DossierSectionsConcern - self.ignored_columns += [:migrated_champ_routage] - enum state: { brouillon: 'brouillon', en_construction: 'en_construction', diff --git a/app/models/procedure.rb b/app/models/procedure.rb index 85887c9ee2a..be4b5ef6a48 100644 --- a/app/models/procedure.rb +++ b/app/models/procedure.rb @@ -78,8 +78,7 @@ class Procedure < ApplicationRecord :durees_conservation_required, :cerfa_flag, :test_started_at, - :lien_demarche, - :migrated_champ_routage + :lien_demarche ] default_scope -> { kept } diff --git a/app/models/procedure_revision.rb b/app/models/procedure_revision.rb index 20decec4cdf..0de68a045b1 100644 --- a/app/models/procedure_revision.rb +++ b/app/models/procedure_revision.rb @@ -13,7 +13,6 @@ # class ProcedureRevision < ApplicationRecord self.implicit_order_column = :created_at - self.ignored_columns += [:migrated_champ_routage] belongs_to :procedure, -> { with_discarded }, inverse_of: :revisions, optional: false belongs_to :dossier_submitted_message, inverse_of: :revisions, optional: true, dependent: :destroy diff --git a/db/migrate/20230801121131_remove_migrated_champ_routage_columns.rb b/db/migrate/20230801121131_remove_migrated_champ_routage_columns.rb new file mode 100644 index 00000000000..4a95b2f7d57 --- /dev/null +++ b/db/migrate/20230801121131_remove_migrated_champ_routage_columns.rb @@ -0,0 +1,7 @@ +class RemoveMigratedChampRoutageColumns < ActiveRecord::Migration[7.0] + def change + safety_assured { remove_column :procedures, :migrated_champ_routage } + safety_assured { remove_column :procedure_revisions, :migrated_champ_routage } + safety_assured { remove_column :dossiers, :migrated_champ_routage } + end +end From 16c0a2cb73a9f2637da3fa68f30b77144ed9785d Mon Sep 17 00:00:00 2001 From: Eric Leroy-Terquem Date: Tue, 1 Aug 2023 16:22:59 +0200 Subject: [PATCH 2/2] db(routing): ignore routing criteria name column --- app/models/procedure.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/procedure.rb b/app/models/procedure.rb index be4b5ef6a48..33b9a7ae5b6 100644 --- a/app/models/procedure.rb +++ b/app/models/procedure.rb @@ -78,7 +78,8 @@ class Procedure < ApplicationRecord :durees_conservation_required, :cerfa_flag, :test_started_at, - :lien_demarche + :lien_demarche, + :routing_criteria_name ] default_scope -> { kept }