Skip to content

Commit 96f01eb

Browse files
committed
chore: add FK to avoid conflict
1 parent 83e05fa commit 96f01eb

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

db/migrate/20260426194058_remove_messages_user_foreign_keys.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
# at the application layer via recipient_type / sender_type.
77
class RemoveMessagesUserForeignKeys < ActiveRecord::Migration[7.2]
88
def up
9-
remove_foreign_key :messages, name: 'fk_rails_12e9de2e48' # recipient_id -> users
10-
remove_foreign_key :messages, name: 'fk_rails_273a25a7a6' # user_id -> users
9+
remove_foreign_key :messages, name: 'fk_rails_12e9de2e48', if_exists: true # recipient_id -> users
10+
remove_foreign_key :messages, name: 'fk_rails_273a25a7a6', if_exists: true # user_id -> users
1111
end
1212

1313
def down

0 commit comments

Comments
 (0)