apps/docs/content/docs/cli/migrate/dev.mdx
The prisma migrate dev command creates and applies migrations during development. It requires a shadow database.
For use in development environments only.
:::warning
This command is not supported on MongoDB. Use db push instead.
:::
prisma migrate dev [options]
The datasource URL configuration is read from the Prisma config file (e.g., prisma.config.ts).
_prisma_migrations table:::info
Prisma v7: migrate dev no longer automatically triggers prisma generate or seed scripts. Run them explicitly if needed.
:::
| 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 |
:::info
If a schema drift is detected while running with --create-only, you will be prompted to reset your database.
:::
npx prisma migrate dev
npx prisma migrate dev --name added_job_title
npx prisma migrate dev --create-only
This creates the migration file but doesn't apply it. Run prisma migrate dev again to apply.
npx prisma migrate dev --schema=./alternative/schema.prisma