Databases
Delete a user and everything they own
Someone asks you to delete their account, and their data is scattered across tables and services.
- What you get
- A map of everywhere personal data lives and one tested routine that removes it.
- Paste it into
- Your AI tool, in your project
The prompt
I need a reliable way to delete a user's account and their data when they ask. Find everywhere this project stores something tied to a person: database tables, uploaded files, the sign-in provider, payment customer records, email lists, analytics and logs. For each, say whether it should be deleted, anonymized, or kept for a legal reason such as invoices. Build one server-side routine that does it in a safe order, works if run twice, and records that it happened without keeping the personal data. Test it on a throwaway account in a local or test setup and show me what remains afterwards. List the steps in outside dashboards that code can't do.
Use it
Open your AI tool (Claude Code, Codex or Cursor) in your project folder and paste it in.
More in Databases
Fill your local app with realistic test data
Your local database is empty, so you test against production or three rows named “test”.
Design your tables before you build
The AI invents a new table every time you add a feature, and nothing lines up.
Check that users can’t read each other’s data
Every signed-in user may be able to fetch every row, and the app only hides it in the interface.
Stop changing the database by hand
You edited tables in the dashboard, and now local, preview and production don’t match.