#prisma database drift

8 messages · Page 1 of 1 (latest)

smoky otter
#

Hey guys, there is a database drift in my local database, but since I work of the copy of my development environment, I don't want to lose my local data through npx prisma migrate dev because it requires me to reset. I just want to properly create an entry in the prisma_migrations table and also create the migration itself in the folder. How can I achieve this?

viscid field
smoky otter
#

isn't this problematic? I already have set the init_0 migration and have already a couple migrations already ran

#

just recently someone added a new column to the database outside the project

#

so I wanted to make that change "official", no easy way to do it other than baselining again?

viscid field
#

Once the database schema is modified outside of the project, then you need to sync it back with prisma. Baselining is the easiest solution, the initial migration will become the current state of the database.

#

It does not hurt to do it ocassionally even if your schema does not drift. So you don't end up with hundreds of migrarions that all need to be run in tests. You replace them with one migrarion that creates the entire schema in the final form.

smoky otter
#

okay got it, not that bad indeed