Hi there! I'm having an issue with marking down mi...
# orm-help
v
Hi there! I'm having an issue with marking down migrations as resolved. I've followed the documentation on generating and applying the down migration with no issues, until I come to the
npx prisma migrate resolve --rolled-back 20220713234002_some_migration
step. When I try to use this to record that the migration has been rolled back, I get the error
Copy code
Error: P3012

Migration `20220713234002_some_migration` cannot be rolled back because it is not in a failed state.
Currently running Prisma v3.15.2.
1
a
Hi Vanessa 👋🏾 Welcome to the Prisma Community! I’ve reached out to or engineering team for further clarification. We will get back to you 🙂
After running the down migration, the next step would be reverting the changes you made in your Prisma schema and creating an up migration using
migrate dev
This is because your Prisma schema, migration history (
/prisma/migrations
folder), and migrations table in the database (
_prisma_migrations
) are one step ahead of the database schema.
The
migrate resolve --rolled-back
command works with failed migrations. In this case, there isn’t a migration failure. Thanks for bringing this up; we’ll update the docs to clarify what
migrate resolve --rolled-back
does and the Down Migrations guide. 🙂
v
Thank you for clearing this up @Alex Ruheni!
🙏🏾 1