Prisma Next is in early access.Read the docs

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

Options

OptionWhat 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.
--jsonPrints a machine-readable result.
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.

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.

On this page