7
0
Ответвление 0
bastodon/db/migrate/20210630000137_fix_canonical_email_blocks_foreign_key.rb

15 строки
583 Б
Ruby

# frozen_string_literal: true
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