Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prisma migrate on an altered DB

Tags:

prisma

Given a team composed of data scientists and developers.

Developers want to use schema.prisma but data scientists don't and want to freely edit the DB directly...

What happen if a data scientist alter the DB directly? Will prisma migrate dev/deploy continue to work correctly?

like image 924
abernier Avatar asked Nov 01 '25 06:11

abernier


1 Answers

If the data scientists alter the database directly then there would be a drift between the prisma schema and the database schema.

So next time when someone invokes prisma migrate dev command, prisma would prompt you to reset the database.

From Documentation:

The migrate dev command will prompt you to reset the database in the following scenarios:

  • Migration history conflicts caused by modified or missing migrations
  • The database schema has drifted away from the end-state of the migration history

It is advisable to stick to only one approach, either updating database only through migrations or just directly updating the database, combining both would lead to an undesirable state.

like image 126
Nurul Sundarani Avatar answered Nov 04 '25 18:11

Nurul Sundarani