docs icon indicating copy to clipboard operation
docs copied to clipboard

Adding workflow to allow creating initial migrations for baselining without resetting development database

Open nurul3101 opened this issue 3 years ago • 3 comments

In the Baselining documentation, we have a requirement that it's necessary to reset the development database: Documentation Link.

In certain cases, users cannot reset their development database as well.

To address this concern, I came across this comment on one of the related issue which suggests using migrate diff commands to create initial migration without needing to reset the development database.

Should we add these commands in docs or maybe add a workflow in docs which would allow generating initial migrations without needing to reset the database?

nurul3101 avatar Jun 01 '22 16:06 nurul3101

The actual problem is this here? https://www.prisma.io/docs/guides/database/developing-with-prisma-migrate/add-prisma-migrate-to-a-project#apply-the-initial-migrations

janpio avatar Jun 01 '22 17:06 janpio

Yes, the actual problem is that to generate initial migrations we require a reset of the development database.

nurul3101 avatar Jun 02 '22 10:06 nurul3101

Here's another instance of this issue cropping up. The user tried to follow our baseline docs but was wary of resetting their DB.

The prisma migrate diff workflow is really useful and should be added to the docs when possible, in my opinion.

austincrim avatar Oct 11 '22 15:10 austincrim

Another instance of community slack user running into this.

nurul3101 avatar Jan 10 '23 07:01 nurul3101

Our getting started has already been changed to use migrate diff, we can do the same here (although we need to figure out in which use cases migrate dev --create-only is actually better).

janpio avatar Jan 10 '23 11:01 janpio

Done: https://www.prisma.io/docs/getting-started/setup-prisma/add-to-existing-project/relational-databases/baseline-your-database-typescript-postgres

ruheni avatar Apr 25 '23 10:04 ruheni