# migration status (/docs/cli/migration-status)

> For the complete Prisma documentation index, see [llms.txt](https://www.prisma.io/docs/llms.txt). A markdown version of any docs page is available by appending `.md` to its URL.

Show the Prisma 8 migration path and pending status.

Location: CLI > migration status

`migration status` shows which migrations are pending between the database marker and the target contract.

Use it before and after [`db migrate`](https://www.prisma.io/docs/cli/db-migrate), and when debugging why an environment is not at the expected contract state.

## Usage [#usage]

  

#### bun

```bash
bunx prisma@latest migration status --db "$DATABASE_URL"
```

#### pnpm

```bash
pnpm dlx prisma@latest migration status --db "$DATABASE_URL"
```

#### yarn

```bash
yarn dlx prisma@latest migration status --db "$DATABASE_URL"
```

#### npm

```bash
npx prisma@latest migration status --db "$DATABASE_URL"
```

## Options [#options]

| Option              | What it does                                                                                                           |
| ------------------- | ---------------------------------------------------------------------------------------------------------------------- |
| `--db <url>`        | Connects to the database.                                                                                              |
| `--space <id>`      | Narrows output to a single contract space.                                                                             |
| `--to <contract>`   | Sets the target contract reference (hash, prefix, ref name, migration directory name, `<dir>^`, or `./path`).          |
| `--from <contract>` | Sets the origin contract reference. With `--from`, the command computes the path offline and does not need a database. |
| `--legend`          | Prints a key for the tree glyphs and lane colors.                                                                      |
| `--ascii`           | Uses ASCII glyphs (pipe-friendly).                                                                                     |
| `--config <path>`   | Read this config file instead of `./prisma.config.ts`.                                                                 |
| `--json`            | Prints a machine-readable result.                                                                                      |

## Examples [#examples]

  

#### bun

```bash
bunx prisma@latest migration status --db "$DATABASE_URL"
bunx prisma@latest migration status --to production
bunx prisma@latest migration status --from abc123 --to production
bunx prisma@latest migration status --ascii
```

#### pnpm

```bash
pnpm dlx prisma@latest migration status --db "$DATABASE_URL"
pnpm dlx prisma@latest migration status --to production
pnpm dlx prisma@latest migration status --from abc123 --to production
pnpm dlx prisma@latest migration status --ascii
```

#### yarn

```bash
yarn dlx prisma@latest migration status --db "$DATABASE_URL"
yarn dlx prisma@latest migration status --to production
yarn dlx prisma@latest migration status --from abc123 --to production
yarn dlx prisma@latest migration status --ascii
```

#### npm

```bash
npx prisma@latest migration status --db "$DATABASE_URL"
npx prisma@latest migration status --to production
npx prisma@latest migration status --from abc123 --to production
npx prisma@latest migration status --ascii
```

## Reading the result [#reading-the-result]

With `--db`, status compares the on-disk migration packages to what has been applied in the database. With `--from`, it computes the path offline instead, without a database.

The `migration` group has three more read-only views: `migration graph` for topology, `migration log` for executed history, and `migration list` for on-disk enumeration. Run each with `--help` for details.

Use [`db verify`](https://www.prisma.io/docs/cli/db-verify) after applying migrations to check the final database shape against the emitted contract.

## Related pages

- [`auth`](https://www.prisma.io/docs/cli/auth): Sign in to your Prisma account from the CLI, sign out, and manage workspace sessions.
- [`branch`](https://www.prisma.io/docs/cli/branch): List platform branches for a project.
- [`bucket`](https://www.prisma.io/docs/cli/bucket): Create and manage object-store buckets.
- [`Configuration`](https://www.prisma.io/docs/cli/configuration): Configure Prisma 8 CLI commands with prisma.config.ts and global flags.
- [`contract emit`](https://www.prisma.io/docs/cli/contract-emit): Emit Prisma 8 contract artifacts.