'Prisma migrate on an altered DB

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?



Solution 1:[1]

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.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Nurul Sundarani