Fix status reactions preventing an on_cascade delete

This commit is contained in:
Jeremy Kescher 2022-12-18 03:07:06 +01:00
parent 3c0af10676
commit eded36676f
No known key found for this signature in database
GPG key ID: 48DFE4BB15BA5940
2 changed files with 16 additions and 1 deletions

View file

@ -0,0 +1,15 @@
class FixForeignKeysStatusReactions < ActiveRecord::Migration[6.1]
disable_ddl_transaction!
def change
remove_foreign_key :status_reactions, :accounts
add_foreign_key :status_reactions, :accounts, on_delete: :cascade, validate: false
validate_foreign_key :status_reactions, :accounts
remove_foreign_key :status_reactions, :statuses
add_foreign_key :status_reactions, :statuses, on_delete: :cascade, validate: false
validate_foreign_key :status_reactions, :statuses
remove_foreign_key :status_reactions, :custom_emojis
add_foreign_key :status_reactions, :custom_emojis, on_delete: :cascade, validate: false
validate_foreign_key :status_reactions, :custom_emojis
end
end

View file

@ -25,7 +25,7 @@ module Mastodon
end end
def suffix_version def suffix_version
'+1.1.0' '+1.1.1'
end end
def to_a def to_a