From bab725fc31eca8a53bf3beca4e297f77e625e921 Mon Sep 17 00:00:00 2001 From: Adam Niedzielski Date: Mon, 29 Jul 2024 13:50:38 +0200 Subject: [PATCH] Add on_delete: :cascade --- db/migrate/20240726143215_create_account_secrets.rb | 2 +- db/schema.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/db/migrate/20240726143215_create_account_secrets.rb b/db/migrate/20240726143215_create_account_secrets.rb index 30cda823e6d..1cdc17a60ca 100644 --- a/db/migrate/20240726143215_create_account_secrets.rb +++ b/db/migrate/20240726143215_create_account_secrets.rb @@ -4,7 +4,7 @@ class CreateAccountSecrets < ActiveRecord::Migration[7.1] def change create_table :account_secrets do |t| t.text :private_key - t.references :account, null: false, foreign_key: true + t.references :account, null: false, foreign_key: { on_delete: :cascade } t.timestamps end diff --git a/db/schema.rb b/db/schema.rb index 618a29baf2d..5188537d573 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -1282,7 +1282,7 @@ ActiveRecord::Schema[7.1].define(version: 2024_07_26_143215) do add_foreign_key "account_pins", "accounts", on_delete: :cascade add_foreign_key "account_relationship_severance_events", "accounts", on_delete: :cascade add_foreign_key "account_relationship_severance_events", "relationship_severance_events", on_delete: :cascade - add_foreign_key "account_secrets", "accounts" + add_foreign_key "account_secrets", "accounts", on_delete: :cascade add_foreign_key "account_stats", "accounts", on_delete: :cascade add_foreign_key "account_statuses_cleanup_policies", "accounts", on_delete: :cascade add_foreign_key "account_warnings", "accounts", column: "target_account_id", on_delete: :cascade