From eb696396a19fd870ca794b99a3ed1882e909afd4 Mon Sep 17 00:00:00 2001 From: Jeremy Kescher Date: Sun, 18 Dec 2022 04:23:42 +0100 Subject: [PATCH] Fix status reactions preventing an on_cascade delete --- db/migrate/20221124114030_create_status_reactions.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/db/migrate/20221124114030_create_status_reactions.rb b/db/migrate/20221124114030_create_status_reactions.rb index bbf1f3376a..5f010c4a0b 100644 --- a/db/migrate/20221124114030_create_status_reactions.rb +++ b/db/migrate/20221124114030_create_status_reactions.rb @@ -1,10 +1,10 @@ class CreateStatusReactions < ActiveRecord::Migration[6.1] def change create_table :status_reactions do |t| - t.references :account, null: false, foreign_key: true - t.references :status, null: false, foreign_key: true + t.references :account, null: false, foreign_key: { on_delete: :cascade } + t.references :status, null: false, foreign_key: { on_delete: :cascade } t.string :name, null: false, default: '' - t.references :custom_emoji, null: true, foreign_key: true + t.references :custom_emoji, null: true, foreign_key: { on_delete: :cascade } t.timestamps end