I'm new to Prisma ORM, & I'm trying to make migrations in Prisma
I see that I way to do this is to update data.model & then just run:
prisma deploy
But what if I want to create a migrations for specific versions of app how could I do that ??
I'm new to Prisma ORM, & I'm trying to make migrations in Prisma
I see that I way to do this is to update data.model & then just run:
prisma deploy
But what if I want to create a migrations for specific versions of app how could I do that ??
As the prisma documentation describes there are two ways of doing database migrations in prisma:
If you follow the first approach and edit your data model the changes will be carried out automagically once you run
prisma deploy
. You can specify the service and stage this will be rolled out to via thePRISMA_ENDPOINT
environment variable:This way you can roll out and test you data model changes in a different stage or on a different service.
The second approach is to manually change the database model via plain SQL. Be careful to ensure the database schema and your data model are in sync.
For more information check out: https://www.prisma.io/docs/datamodel-and-migrations/migrations-POSTGRES-asd4/