mirror of
https://github.com/mastodon/mastodon.git
synced 2024-12-22 22:15:23 +01:00
28 lines
719 B
Ruby
28 lines
719 B
Ruby
# frozen_string_literal: true
|
|
|
|
class FixNotificationPoliciesForeignKey < ActiveRecord::Migration[7.1]
|
|
def up
|
|
safety_assured do
|
|
execute <<~SQL.squish
|
|
ALTER TABLE notification_policies
|
|
DROP CONSTRAINT fk_rails_506d62f0da,
|
|
ADD CONSTRAINT fk_rails_506d62f0da
|
|
FOREIGN KEY (account_id)
|
|
REFERENCES accounts(id)
|
|
ON DELETE CASCADE
|
|
SQL
|
|
end
|
|
end
|
|
|
|
def down
|
|
safety_assured do
|
|
execute <<~SQL.squish
|
|
ALTER TABLE notification_policies
|
|
DROP CONSTRAINT fk_rails_506d62f0da,
|
|
ADD CONSTRAINT fk_rails_506d62f0da
|
|
FOREIGN KEY (account_id)
|
|
REFERENCES accounts(id)
|
|
SQL
|
|
end
|
|
end
|
|
end
|