dev
The prisma migrate dev command creates and applies migrations during development. It requires a shadow database.
For use in development environments only.
prisma migrate dev [options]The datasource URL configuration is read from the Prisma config file (e.g., prisma.config.ts).
- Reruns the existing migration history in the shadow database to detect schema drift
- Applies pending migrations to the shadow database
- Generates a new migration from any changes you made to the Prisma schema
- Applies all unapplied migrations to the development database and updates the
_prisma_migrationstable
| Option | Description |
|---|---|
-h, --help |
Display help message |
--config |
Custom path to your Prisma config file |
--schema |
Custom path to your Prisma schema |
--url |
Override the datasource URL from the Prisma config file |
-n, --name |
Name the migration |
--create-only |
Create a new migration but do not apply it |
bunx prisma migrate devpnpm prisma migrate devyarn prisma migrate devnpx prisma migrate devbunx prisma migrate dev --name added_job_titlepnpm prisma migrate dev --name added_job_titleyarn prisma migrate dev --name added_job_titlenpx prisma migrate dev --name added_job_titlebunx prisma migrate dev --create-onlypnpm prisma migrate dev --create-onlyyarn prisma migrate dev --create-onlynpx prisma migrate dev --create-onlyThis creates the migration file but doesn't apply it. Run prisma migrate dev again to apply.
bunx prisma migrate dev --schema=./alternative/schema.prismapnpm prisma migrate dev --schema=./alternative/schema.prismayarn prisma migrate dev --schema=./alternative/schema.prismanpx prisma migrate dev --schema=./alternative/schema.prisma