Delete access tokens on user delete (#34036)
Trying to delete a user record from our admin panel throws the following error: `update or delete on table "users" violates foreign key constraint "access_tokens_user_id_fkey" on table "access_tokens" Detail: Key (id)=(....) is still referenced from table "access_tokens".` We need to add a cascade delete to the `access_tokens` table. Release Notes: - N/A
This commit is contained in:
parent
3327f90e0f
commit
60e9ab8f93
3 changed files with 54 additions and 1 deletions
|
@ -0,0 +1,3 @@
|
|||
ALTER TABLE access_tokens DROP CONSTRAINT access_tokens_user_id_fkey;
|
||||
ALTER TABLE access_tokens ADD CONSTRAINT access_tokens_user_id_fkey
|
||||
FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
|
Loading…
Add table
Add a link
Reference in a new issue