Fix missing on_delete: :cascade for canonical_email_blocks foreign key (#16448)
parent
7c27ccb8d8
commit
653c925beb
@ -0,0 +1,13 @@ |
||||
class FixCanonicalEmailBlocksForeignKey < ActiveRecord::Migration[6.1] |
||||
def up |
||||
safety_assured do |
||||
execute 'ALTER TABLE canonical_email_blocks DROP CONSTRAINT fk_rails_1ecb262096, ADD CONSTRAINT fk_rails_1ecb262096 FOREIGN KEY (reference_account_id) REFERENCES accounts(id) ON DELETE CASCADE;' |
||||
end |
||||
end |
||||
|
||||
def down |
||||
safety_assured do |
||||
execute 'ALTER TABLE canonical_email_blocks DROP CONSTRAINT fk_rails_1ecb262096, ADD CONSTRAINT fk_rails_1ecb262096 FOREIGN KEY (reference_account_id) REFERENCES accounts(id);' |
||||
end |
||||
end |
||||
end |
Loading…
Reference in new issue