From e83f5fe47533b23fae3a882adb18eb624085ac76 Mon Sep 17 00:00:00 2001 From: Martin Date: Wed, 6 Apr 2022 15:52:46 +0200 Subject: [PATCH] fix(user.merge): when merging old_user having an instructeur with dossier_operation_logs containing the old_user.instructeur_id, should be able to merge to new instructeur feat(user.merge): when user have an instructeur having dossier_opertions_logs containing instructeur_id --- app/models/dossier_operation_log.rb | 1 - ...emove_column_instructeur_id_from_dossier_operation_log.rb | 5 +++++ db/schema.rb | 3 --- 3 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 db/migrate/20220406144202_remove_column_instructeur_id_from_dossier_operation_log.rb diff --git a/app/models/dossier_operation_log.rb b/app/models/dossier_operation_log.rb index 9a348680f..ac29ae529 100644 --- a/app/models/dossier_operation_log.rb +++ b/app/models/dossier_operation_log.rb @@ -12,7 +12,6 @@ # updated_at :datetime not null # bill_signature_id :bigint # dossier_id :bigint -# instructeur_id :bigint # class DossierOperationLog < ApplicationRecord enum operation: { diff --git a/db/migrate/20220406144202_remove_column_instructeur_id_from_dossier_operation_log.rb b/db/migrate/20220406144202_remove_column_instructeur_id_from_dossier_operation_log.rb new file mode 100644 index 000000000..5cb117776 --- /dev/null +++ b/db/migrate/20220406144202_remove_column_instructeur_id_from_dossier_operation_log.rb @@ -0,0 +1,5 @@ +class RemoveColumnInstructeurIdFromDossierOperationLog < ActiveRecord::Migration[6.1] + def change + safety_assured { remove_column :dossier_operation_logs, :instructeur_id } + end +end diff --git a/db/schema.rb b/db/schema.rb index d59c95dd9..c9dddb756 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -267,13 +267,11 @@ ActiveRecord::Schema.define(version: 2022_04_07_081538) do t.text "digest" t.bigint "dossier_id" t.datetime "executed_at" - t.bigint "instructeur_id" t.datetime "keep_until" t.string "operation", null: false t.datetime "updated_at", null: false t.index ["bill_signature_id"], name: "index_dossier_operation_logs_on_bill_signature_id" t.index ["dossier_id"], name: "index_dossier_operation_logs_on_dossier_id" - t.index ["instructeur_id"], name: "index_dossier_operation_logs_on_instructeur_id" t.index ["keep_until"], name: "index_dossier_operation_logs_on_keep_until" end @@ -872,7 +870,6 @@ ActiveRecord::Schema.define(version: 2022_04_07_081538) do add_foreign_key "commentaires", "dossiers" add_foreign_key "commentaires", "experts" add_foreign_key "dossier_operation_logs", "bill_signatures" - add_foreign_key "dossier_operation_logs", "instructeurs" add_foreign_key "dossier_transfer_logs", "dossiers" add_foreign_key "dossiers", "dossier_transfers" add_foreign_key "dossiers", "groupe_instructeurs"