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