makers.bolt.fun icon indicating copy to clipboard operation
makers.bolt.fun copied to clipboard

Update: Handle database relations in case of deleting user

Open MTG2000 opened this issue 2 years ago • 1 comments

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.

MTG2000 avatar Dec 18 '23 09:12 MTG2000

Deploy Preview for boltfun ready!

Name Link
Latest commit 1a8b2eab05ea638d70d4f59e7863d37acd752ca6
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.

netlify[bot] avatar Dec 18 '23 09:12 netlify[bot]