https://github.com/jpnws/express1
https://github.com/jpnws/express1
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/jpnws/express1
- Owner: jpnws
- Created: 2024-02-24T17:51:34.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-02-29T05:06:02.000Z (about 1 year ago)
- Last Synced: 2025-01-12T11:46:06.065Z (4 months ago)
- Language: JavaScript
- Size: 291 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Prisma
### Create and apply migrations
`npx prisma migrate dev`
This command:
1. Reruns the existing migration history in the shadow database in order to detect schema drift (edited or deleted migration file, or a manual changes to the database schema)
2. Applies pending migrations to the shadow database (for example, new migrations created by colleagues)
3. If it detects changes to the Prisma schema, it generates a new migration from these changes
4. Applies all unapplied migrations to the development database and updates the \_prisma_migrations table
5. Triggers the generation of artifacts (for example, Prisma Client)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### Reset the development database
`npx prisma migrate reset`
This command:
1. Drops the database/schema¹ if possible, or performs a soft reset if the
environment does not allow deleting databases/schemas¹
2. Creates a new database/schema¹ with the same name if the database/schema¹ was
dropped
3. Applies all migrations
4. Runs seed scripts