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
|
@ -26,7 +26,7 @@ CREATE UNIQUE INDEX "index_users_on_github_user_id" ON "users" ("github_user_id"
|
|||
|
||||
CREATE TABLE "access_tokens" (
|
||||
"id" INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
"user_id" INTEGER REFERENCES users (id),
|
||||
"user_id" INTEGER REFERENCES users (id) ON DELETE CASCADE,
|
||||
"impersonated_user_id" INTEGER REFERENCES users (id),
|
||||
"hash" VARCHAR(128)
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue