PrismaP
Prisma11mo ago
4 replies
Wiznet

Prisma not rolling back failed migration during vercel deployment

I've ran into a strange situation where during a deployment to vercel, I run the prisma generate && prisma migrate deploy as a build command. I had a migration fail during this. I went through, rolled it back, fixed it, then pushed the changes back to production. However, I noticed that prisma was not attempting to re-run the migration as it was marked as failed in the _prisma_migrations tables. I had to manually delete the migration entry for the migration to re apply correctly. My question is: Is there a correct process for re running failed migrations in production? I followed the instructions here https://www.prisma.io/docs/orm/prisma-migrate/workflows/patching-and-hotfixing#option-2-manually-complete-migration-and-resolve-as-applied. However it doesnt seem the migration was marked as rolled back.
- Does rolled back have to be run in production OR can we run it locally and merge to production?
How to reconcile the migration history after applying a hotfix or patch to a production environment.
Patching & hotfixing | Prisma Documentation
Was this page helpful?