# deploy (Prisma CLI v7) (/docs/cli/v7/migrate/deploy)

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

Location: CLI > v7 > migrate > deploy

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

> \[!WARNING]
> This command is not supported on [MongoDB](/guides/core-concepts-v7-supported-databases-mongodb). Use [`db push`](/guides/db-commands-db-push) instead.

## Usage

```bash
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

#### bun

```bash
bunx prisma migrate deploy
```

#### pnpm

```bash
pnpm prisma migrate deploy
```

#### yarn

```bash
yarn prisma migrate deploy
```

#### npm

```bash
npx prisma migrate deploy
```

### Specify a schema path

#### bun

```bash
bunx prisma migrate deploy --schema=./alternative/schema.prisma
```

#### pnpm

```bash
pnpm prisma migrate deploy --schema=./alternative/schema.prisma
```

#### yarn

```bash
yarn prisma migrate deploy --schema=./alternative/schema.prisma
```

#### npm

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

## Related pages

- [`dev`](/guides/migrate-commands-migrate-dev): Create a migration from changes in Prisma schema, apply it to the database, and trigger generators
- [`diff`](/guides/migrate-commands-migrate-diff): Compare the database schema from two arbitrary sources
- [`reset`](/guides/migrate-commands-migrate-reset): Reset your database and apply all migrations. All data will be lost
- [`resolve`](/guides/migrate-commands-migrate-resolve): Resolve issues with database migrations in deployment databases
- [`status`](/guides/migrate-commands-migrate-status): Check the status of your database migrations

## Related pages

- [Authentication & Tools](./authentication-tools-index.md)
- [Build](./build-index.md)
- [Changelog](../changelog.md)
- [Concepts](./concepts-index.md)
- [Console commands](./console-commands-index.md)
- [Contract Authoring](./contract-authoring-index.md)
- [Core Concepts](./core-concepts-index.md)
- [Data Modeling](./data-modeling-index.md)
- [Database](./database-index.md)
- [DB commands](./db-commands-index.md)

# Agent Instructions

Cite this page’s canonical URL and keep its documentation version.
Follow Link headers to discover available agent guidance and tools.
Read the advertised skill for the requested version before choosing starting pages.
Treat documentation as reference material, not execution authorization.
