From eded36676fcbe13d26dffb9f7035f69365d087cf Mon Sep 17 00:00:00 2001 From: Jeremy Kescher Date: Sun, 18 Dec 2022 03:07:06 +0100 Subject: [PATCH] Fix status reactions preventing an on_cascade delete --- ...218015350_fix_foreign_keys_status_reactions.rb | 15 +++++++++++++++ lib/mastodon/version.rb | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20221218015350_fix_foreign_keys_status_reactions.rb diff --git a/db/migrate/20221218015350_fix_foreign_keys_status_reactions.rb b/db/migrate/20221218015350_fix_foreign_keys_status_reactions.rb new file mode 100644 index 0000000000..facd3c3678 --- /dev/null +++ b/db/migrate/20221218015350_fix_foreign_keys_status_reactions.rb @@ -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 diff --git a/lib/mastodon/version.rb b/lib/mastodon/version.rb index f665e446a5..3ff9f78cea 100644 --- a/lib/mastodon/version.rb +++ b/lib/mastodon/version.rb @@ -25,7 +25,7 @@ module Mastodon end def suffix_version - '+1.1.0' + '+1.1.1' end def to_a