26778823b9
Squashed, modified, and rebased from glitch-soc/mastodon#2221. Co-authored-by: fef <owo@fef.moe> Co-authored-by: Jeremy Kescher <jeremy@kescher.at> Co-authored-by: neatchee <neatchee@gmail.com> Co-authored-by: Ivan Rodriguez <104603218+IRod22@users.noreply.github.com> Co-authored-by: Plastikmensch <plastikmensch@users.noreply.github.com>
19 lines
829 B
Ruby
19 lines
829 B
Ruby
# frozen_string_literal: true
|
|
|
|
class FixForeignKeysStatusReactions < ActiveRecord::Migration[6.1]
|
|
disable_ddl_transaction!
|
|
|
|
def change
|
|
# Fixes an oversight in a previous version of the CreateStatusReactions migration
|
|
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
|