Free fixes / Card 6
Database schema missing in production
Symptom
App boots locally. On deploy you get Prisma / Drizzle / SQL errors like "table does not exist," "column not found," or migrate failures in the build or first request.
Plain English
Your laptop ran migrations (or you clicked around in a local DB UI). Production is an empty database. Shipping code without running the same migrations against the production DB leaves the schema behind.
Checklist
- Confirm which ORM/migrator you use (Prisma, Drizzle, Knex, raw SQL).
- Check whether the host runs migrations on release (release command / build step) or you must run them once by hand.
- Point the production DATABASE_URL at the real prod DB (not the local one).
- Run the migrate/deploy command against production once, then redeploy the app.
- Never point a local migrate at production by accident; verify the URL host first.
Paste-ready fix prompt
Paste this into Cursor, Claude, Copilot, Lovable, Bolt, or whichever coding agent you use.
Production fails with missing table/column or migrate errors after a local success. Assume schema drift first.
1. Identify the ORM and migration tool in this repo.
2. Show the exact migrate/deploy command for production.
3. Tell me where to put it on my host (release phase vs one-off) for this stack.
4. List env vars that must differ for the production database URL.
5. Add a safe startup check that fails clearly if a required table is missing. Do not redesign the schema.Still stuck?
This card covers the most common version of this break. If yours is different, send it in for a custom pass.