Skip to content

Latest commit

 

History

History
34 lines (22 loc) · 770 Bytes

db-prisma.md

File metadata and controls

34 lines (22 loc) · 770 Bytes

DP - Prisma: Best practices and useful commands

deploy25

1- After Schema modification

After a schema (model) modification, we need to generate a migration :

$ npx prisma migrate dev --name 'migration-name'

Replace migration-name by a name describing the goal of this modificatio, for example:

$ npx prisma migrate dev --name 'user-topics'

Then let know the rest of the team that a shema modification has been done and merged. They need to git-pull and run the migration.

2- Applying migrations

After pullin a schema modofocation and a new migration, We need to run the new migration:

$ npx prisma migrate dev

If error because of schema synchronisation problem:

$ npx prisma migrate reset