# prisma-next migration plan (/docs/cli/next/migration-plan)

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

Plan an on-disk migration from Prisma Next contract changes.

Location: CLI > Next > prisma-next migration plan

`prisma-next migration plan` compares the emitted contract against the latest on-disk migration state and creates a migration package.

The command is offline. It does not need a database connection.

## Usage [#usage]

```bash
prisma-next migration plan --name add-users-table
```

## Options [#options]

| Option            | What it does                                                                   |
| ----------------- | ------------------------------------------------------------------------------ |
| `--config <path>` | Reads a specific `prisma-next.config.ts` file.                                 |
| `--name <slug>`   | Sets the migration directory name suffix. Defaults to `migration`.             |
| `--from <hash>`   | Uses a specific starting contract hash instead of the latest migration target. |
| `--json`          | Prints a machine-readable result.                                              |

## Recommended flow [#recommended-flow]

```bash
prisma-next contract emit
prisma-next migration plan --name add-users-table
prisma-next migration show
```

Review the generated migration package before applying it with [`prisma-next migration apply`](https://www.prisma.io/docs/cli/next/migration-apply).

## When to use migration plan [#when-to-use-migration-plan]

Use `migration plan` when your team wants database changes reviewed in version control. For local prototypes where review is not needed, [`prisma-next db update`](https://www.prisma.io/docs/cli/next/db-update) is usually faster.

If the generated migration is not the migration you want, use [`prisma-next migration new`](https://www.prisma.io/docs/cli/next/migration-new) and author the migration manually.

## Related pages

- [`CLI configuration`](https://www.prisma.io/docs/cli/next/configuration): Configure Prisma Next CLI commands with prisma-next.config.ts and global flags.
- [`prisma-next contract emit`](https://www.prisma.io/docs/cli/next/contract-emit): Emit Prisma Next contract artifacts.
- [`prisma-next contract infer`](https://www.prisma.io/docs/cli/next/contract-infer): Infer a starter contract from an existing database.
- [`prisma-next db init`](https://www.prisma.io/docs/cli/next/db-init): Initialize a database from the current Prisma Next contract.
- [`prisma-next db schema`](https://www.prisma.io/docs/cli/next/db-schema): Inspect a live database schema.