forked from mastodon/mastodon
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3465307
commit 1959365
Showing
2 changed files
with
30 additions
and
2 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
db/migrate/20240510192043_fix_notification_policies_foreign_key.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters