Skip to main content
Prisma Documentation Docs

Search documentation

Type to search this documentation.

On this pageOverview

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).

  1. Reruns the existing migration history in the shadow database to detect schema drift
  2. Applies pending migrations to the shadow database
  3. Generates a new migration from any changes you made to the Prisma schema
  4. Applies all unapplied migrations to the development database and updates the _prisma_migrations table
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
title="bun"
bunx prisma migrate dev
pnpm
pnpm prisma migrate dev
yarn
yarn prisma migrate dev
npm
npx prisma migrate dev
title="bun"
bunx prisma migrate dev --name added_job_title
pnpm
pnpm prisma migrate dev --name added_job_title
yarn
yarn prisma migrate dev --name added_job_title
npm
npx prisma migrate dev --name added_job_title
title="bun"
bunx prisma migrate dev --create-only
pnpm
pnpm prisma migrate dev --create-only
yarn
yarn prisma migrate dev --create-only
npm
npx prisma migrate dev --create-only

This creates the migration file but doesn't apply it. Run prisma migrate dev again to apply.

title="bun"
bunx prisma migrate dev --schema=./alternative/schema.prisma
pnpm
pnpm prisma migrate dev --schema=./alternative/schema.prisma
yarn
yarn prisma migrate dev --schema=./alternative/schema.prisma
npm
npx prisma migrate dev --schema=./alternative/schema.prisma
Suggest an edit

Propose a replacement for this page. The site team reviews it before applying any changes.

Export
Documentation menu