remove cascading deletes

This commit is contained in:
Cam 2024-02-07 15:07:43 -06:00
parent f77404b4db
commit 8d51fce2b8
No known key found for this signature in database
GPG Key ID: 367B7C7EBD84A8BD
2 changed files with 2 additions and 2 deletions

View File

@ -4,4 +4,4 @@
ALTER TABLE password_reset_requests DROP CONSTRAINT password_reset_requests_account_id_key;
-- add new constraint which doesnt mind having multiple resets for account ids
ALTER TABLE password_reset_requests ADD CONSTRAINT password_reset_requests_account_id_key FOREIGN KEY (account_id) REFERENCES accounts (id) ON DELETE CASCADE;
ALTER TABLE password_reset_requests ADD CONSTRAINT password_reset_requests_account_id_key FOREIGN KEY (account_id) REFERENCES accounts (id);

View File

@ -7,7 +7,7 @@ CREATE TABLE password_reset_requests (
token string not null unique,
created_at datetime not null default(strftime('%Y-%m-%d %H:%M:%f', 'now')),
updated_at datetime not null default(strftime('%Y-%m-%d %H:%M:%f', 'now')),
account_id integer not null constraint fk_accounts_password_reset_requests references accounts on delete cascade,
account_id integer not null constraint fk_accounts_password_reset_requests references accounts,
deleted boolean not null default(false),
constraint chk_token check(token <> '')