WaspW
Wasp11mo ago
fred-123

Migrate found failed migrations in the target database (Error: P3009)

I have a Wasp 0.15 web app deployed on Fly.io. After my latest deployment, the app crashed because some Prisma migrations couldn’t be applied. Now my Fly.io machine is in a stopped state, and I can’t access my app.


I get this in the server logs:

migrate found failed migrations in the target database, new migrations will not be applied. Read more about how to resolve migration issues in a production database: https://pris.ly/d/migrate-resolve

Can I safely follow the instructions from the prisma documentation or does this work differently in wasp?

I have deleted my local migrations file, ran wasp db migrate-dev and redeployed but it also didn't help.

I am not sure what the difference between staging and prod db schema is, I think it should be the same, though i changes some stuff 2 days ago for a test, but i thought i reversed that.

How can I now move on and recover from that without loosing user data?
I do have snapshots of the db.
How to reconcile the migration history after applying a hotfix or patch to a production environment.
Was this page helpful?