Failed migrations won't let me deploy again

Yesterday I wanted to deploy again and it failed because of a failed migration. I added another field to a table with a value that shall be “TEXT NOT NULL” but that table already has some dummy entries.

So I want to follow the guide Migration troubleshooting in production | Prisma Docs but when I want to rollback a migration is tells me the following:

Migration `20220606170225_development_update` cannot be rolled back because it is not in a failed state.

I tried all the migrations I have and get the same message for all of them but it still doesn’t let me deploy on top of it.

I don’t really care about the data (yet) that is inside this table. How can I resolve this? I can not connect to the prod db with fly ssh console -C database-cli to do it myself (because its dead?).

Any help is appreciated, as I am quite new to fullstack stuff.

If I understand the problem right, you’ll need to delete the 20220606170225_development_update migration and then redeploy.

Prisma should be running migrations in transactions and rolling them back if they fail. But each time you deploy, it will try and run the migration again. Removing the failing migration should let the deploy continue.

Thank you for looking into this.
So I deleted the migrations in my project folder and it still fails at the same step.

I tried marking it as rolled-back as well as resolving but both don’t do anything.
I thought about just deleting the app on Fly and recreating it but that doesn’t solve my issue if it happens again in the future :confused: