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

Update: Handle database relations in case of deleting user #289

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MTG2000
Copy link
Contributor

@MTG2000 MTG2000 commented Dec 18, 2023

Previously, it was not possible to directly delete a user entry from the Users db table, because there are a lot of tables with relations to the user, & you need to manually delete those entries with relation before deleting the user's entry.

But obviously, this is very tedious, so I've updated the DB schema to include rules for automatic handling of the deletion of the user.

All the entries with a user relation will be automatically deleted when a user is deleted EXCEPT:

  • Vote
  • Story
  • Question
  • Donation

Those above will be set the user_id field to null.

@johnsBeharry
If you have some different thoughts on the rules, let me know.

NOTE
I haven't migrated these DB updates on the production DB, so the deploy preview won't likely work correctly.

Copy link

netlify bot commented Dec 18, 2023

Deploy Preview for boltfun ready!

Name Link
🔨 Latest commit 1a8b2ea
🔍 Latest deploy log https://app.netlify.com/sites/boltfun/deploys/65800baf68601b0008de848b
😎 Deploy Preview https://deploy-preview-289--boltfun.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

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 this pull request may close these issues.

1 participant