fix(migration): use strong migration to add fk without validation first, then apply fk validation
This commit is contained in:
parent
b3d2ca1486
commit
82d70912c8
3 changed files with 7 additions and 1 deletions
|
@ -1,5 +1,5 @@
|
||||||
class AddProcedureForeignKeyToBulkMessages < ActiveRecord::Migration[7.0]
|
class AddProcedureForeignKeyToBulkMessages < ActiveRecord::Migration[7.0]
|
||||||
def change
|
def change
|
||||||
add_foreign_key :bulk_messages, :procedures
|
add_foreign_key :bulk_messages, :procedures, validate: false
|
||||||
end
|
end
|
||||||
end
|
end
|
5
db/migrate/20240325140538_validate_fk_on_bulk_message.rb
Normal file
5
db/migrate/20240325140538_validate_fk_on_bulk_message.rb
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
class ValidateFkOnBulkMessage < ActiveRecord::Migration[7.0]
|
||||||
|
def change
|
||||||
|
validate_foreign_key :bulk_messages, :procedures
|
||||||
|
end
|
||||||
|
end
|
|
@ -1209,6 +1209,7 @@ ActiveRecord::Schema[7.0].define(version: 2024_03_25_160237) do
|
||||||
add_foreign_key "avis", "dossiers"
|
add_foreign_key "avis", "dossiers"
|
||||||
add_foreign_key "avis", "experts_procedures"
|
add_foreign_key "avis", "experts_procedures"
|
||||||
add_foreign_key "batch_operations", "instructeurs"
|
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", "bulk_messages"
|
||||||
add_foreign_key "bulk_messages_groupe_instructeurs", "groupe_instructeurs"
|
add_foreign_key "bulk_messages_groupe_instructeurs", "groupe_instructeurs"
|
||||||
add_foreign_key "champs", "champs", column: "parent_id"
|
add_foreign_key "champs", "champs", column: "parent_id"
|
||||||
|
|
Loading…
Reference in a new issue