rift detected: Your database schema is not in sync with your migration history

Hello, I need some help with some drift happening with my production database with Prisma (6.5), Postgre SQL and Next.js. Seems like its considering almost all tables to be new tables, while they are actually the same. It looks like I have more migrations instances in my _prisma_migrations table on the remote (supabase) than I have in local... Its weird as I haven't performed any migration in a few months. Tried to pull the remote schema, and then relaunch my new migration.. Still failling. Is there a solution here other than resetting my database? Thanks for the help!
No description
5 Replies
Prisma AI Help
You decided to hold for human wisdom. We'll chime in soon! Meanwhile, #ask-ai is there if you need a quick second opinion.
Marvingg
MarvinggOP3w ago
Error: - The migrations recorded in the database diverge from the local migrations directory. Last common migration: 20250322165606_reboot_data_modelling_from_freelz. Migrations applied to the database but absent from the migrations directory are: 20250111170818_initial_platform_architecture etc.... Is there a way to pull those migrations to local to avoid the drift and having to reset it?
Nurul
Nurul3w ago
Can you recover the missing migration files and place them back into your local prisma/migrations directory. This will bring your local migration history back in sync with the database
Marvingg
MarvinggOP3w ago
Thank you, I couldn't. Had to delete all migrations file and create a new baseline to make it work..
Nurul
Nurul2w ago
Thank you for letting me know. Is it working as expected after baselining?

Did you find this page helpful?