Migration ran locally, skipped on production
A practical fix and a copyable AI coding prompt. Replace bracketed placeholders with your project details.
1. Check the problem
Most ORMs run migrations on your dev machine but need a manual or build-step trigger in production. Add `prisma migrate deploy` to your build command, or run Drizzle Kit's push in a postbuild script. Test it once against staging first.
2. Use the prompt
My database migration ran locally but never applied in production. I'm using [Prisma/Drizzle] on [Vercel/...]. Show me how to wire migrations into the deploy step, for example prisma migrate deploy in the build command, and how to test it once against a staging database before I rely on it.3. Verify the fix
Review the proposed diff, run the relevant checks and exercise the original failing flow before merging.
Continue in the related workflow chapter.