mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-12-14 00:08:46 +00:00
Merge commit '1959365c2f410aa82874c5c05ab92c4eca4c4055' into glitch-soc/merge-upstream
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
# 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
|
||||
Reference in New Issue
Block a user