Databases
Stop changing the database by hand
You edited tables in the dashboard, and now local, preview and production don’t match.
- What you get
- Your current schema captured in migration files, and one routine for every future change.
- Paste it into
- Your AI tool, in your project
The prompt
I've been changing my database by clicking in the dashboard, and my environments have drifted apart. 1. Compare the schema the code expects with what each database I can reach really has. List the differences. 2. Set up migrations with the tool this stack already supports, and capture the current production schema as the starting point without changing any data. 3. Write the routine for future changes: create a migration, run it locally, check it, then apply it to production. 4. Add a short section to the README with those commands. Don't run anything against production. Give me those commands to run myself and tell me what output to expect.
Use it
Open your AI tool (Claude Code, Codex or Cursor) in your project folder and paste it in.
More in Databases
Find out if you could get your data back
You assume the database is backed up and have never tried a restore.
Find the queries that slow your pages
Pages got slower as data grew, and adding a cache only hid it.
Fix “too many connections” errors
The database refuses connections under light traffic on a serverless host.
Rename or remove a column without losing data
A simple rename can break the live app or wipe a column for good.