Merge pull request #10195 from demarches-simplifiees/fix-bulk-message-fk-migration

fix(migration): use strong migration to add fk without validation first, then apply fk validation
This commit is contained in:
Eric Leroy-Terquem 2024-03-26 09:50:43 +00:00 committed by GitHub
commit 15b5c5b6dd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 7 additions and 1 deletions

View file

@ -1,5 +1,5 @@
class AddProcedureForeignKeyToBulkMessages < ActiveRecord::Migration[7.0]
def change
add_foreign_key :bulk_messages, :procedures
add_foreign_key :bulk_messages, :procedures, validate: false
end
end

View file

@ -0,0 +1,5 @@
class ValidateFkOnBulkMessage < ActiveRecord::Migration[7.0]
def change
validate_foreign_key :bulk_messages, :procedures
end
end

View file

@ -1209,6 +1209,7 @@ ActiveRecord::Schema[7.0].define(version: 2024_03_25_160237) do
add_foreign_key "avis", "dossiers"
add_foreign_key "avis", "experts_procedures"
add_foreign_key "batch_operations", "instructeurs"
add_foreign_key "bulk_messages", "procedures"
add_foreign_key "bulk_messages_groupe_instructeurs", "bulk_messages"
add_foreign_key "bulk_messages_groupe_instructeurs", "groupe_instructeurs"
add_foreign_key "champs", "champs", column: "parent_id"