Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Foreign keys are not respected on row deletion #569

Closed
brassy-endomorph opened this issue Sep 10, 2024 · 0 comments · Fixed by #572
Closed

Foreign keys are not respected on row deletion #569

brassy-endomorph opened this issue Sep 10, 2024 · 0 comments · Fixed by #572

Comments

@brassy-endomorph
Copy link
Collaborator

Is your feature request related to a problem? Please describe.

STR (in the dev env):

  1. Create a user
  2. Open a private window, submit a message
  3. Delete that user via sqlite3 CLI with delete from users;
  4. Create a new user
  5. Login and look at inbox

Expected result: inbox is empty.

Actual result: inbox shows previous message

Why? Step 3 allows deleting rows from the users table when the foreign keys should prevent that (or should cascade to delete related rows).

Describe the solution you'd like

Within SQLite, we can enable the foreign_key_check pragma.

Ideally we should just switch to Postgres across the board as per #557

Additional context

This only affects the dev and test environments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant