# Delete access tokens on user delete \(\#34036\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/60e9ab8f9381b7c2bc1f82b2f84ba346c537b386)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 60e9ab8f9381b7c2bc1f82b2f84ba346c537b386

Requested commit: 60e9ab8f9381b7c2bc1f82b2f84ba346c537b386

Commit: 60e9ab8f9381b7c2bc1f82b2f84ba346c537b386

Tree: ad90b2e86bce07e1605b5b4ca91dc23fc85ff9d4

Author: Joseph T\. Lyons

Committer: GitHub

## Message

```
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
```

## Parents

- [3327f90e0f1ffa431e6598a968b6d88d8e5675dc](https://git.cafe/gitcafe/zed/commit/3327f90e0f1ffa431e6598a968b6d88d8e5675dc?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/60e9ab8f9381b7c2bc1f82b2f84ba346c537b386?format=markdown)
