prisma-next migration plan
Plan an on-disk migration from Prisma Next contract changes.
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
prisma-next migration plan --name add-users-tableOptions
| 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
prisma-next contract emit
prisma-next migration plan --name add-users-table
prisma-next migration showReview the generated migration package before applying it with prisma-next migration apply.
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 is usually faster.
If the generated migration is not the migration you want, use prisma-next migration new and author the migration manually.