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.
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
| Option | Description |
|---|---|
-h, --help | Display help message |
--config | Custom path to your Prisma config file |
--schema | Custom path to your Prisma schema |
Examples
Deploy pending migrations
npx prisma migrate deploySpecify a schema path
npx prisma migrate deploy --schema=./alternative/schema.prisma