deploy

Apply pending migrations to update the database schema in production/staging

The prisma migrate deploy command applies all pending migrations and creates the database if it doesn't exist. Primarily used in non-development environments.

This command is not supported on MongoDB. Use db push instead.

Usage

prisma migrate deploy [options]

The datasource URL configuration is read from the Prisma config file (e.g., prisma.config.ts).

Characteristics

  • Does not look for drift in the database or changes in the Prisma schema
  • Does not reset the database or generate artifacts
  • Does not rely on a shadow database

Options

OptionDescription
-h, --helpDisplay help message
--configCustom path to your Prisma config file
--schemaCustom path to your Prisma schema

Examples

Deploy pending migrations

npx prisma migrate deploy

Specify a schema path

npx prisma migrate deploy --schema=./alternative/schema.prisma

On this page