diff --git a/db/migrate/20250828155921_create_account_secrets.rb b/db/migrate/20250828155921_create_account_secrets.rb index 0e10c61dd37..a7c45dbe91a 100644 --- a/db/migrate/20250828155921_create_account_secrets.rb +++ b/db/migrate/20250828155921_create_account_secrets.rb @@ -3,7 +3,7 @@ class CreateAccountSecrets < ActiveRecord::Migration[8.0] def change create_table :account_secrets do |t| - t.references :account, null: false, foreign_key: true, index: { unique: true } + t.references :account, null: false, foreign_key: { on_delete: :cascade }, index: { unique: true } t.text :private_key t.timestamps diff --git a/db/schema.rb b/db/schema.rb index 14a4f6b18ef..e3e834b1f1e 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -1364,7 +1364,7 @@ ActiveRecord::Schema[8.0].define(version: 2025_08_29_133404) 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