Skip to main content
prisma-next migration show renders the full details of a single migration package: its planned operations with operation-class badges, a DDL preview of the changes, metadata such as the migrationHash, and a prominently highlighted warning when the migration contains destructive operations. It is a read-only inspection command and never modifies any files.

Options

string
Which migration to inspect. Accepts:
  • A directory path (any string containing / or \) — reads that directory directly.
  • A migrationHash prefix (git-style matching) — scans all attested migrations and returns the one whose hash starts with the given prefix.
  • Omitted — defaults to the latest migration in the graph.
string
Path to prisma-next.config.ts. Defaults to ./prisma-next.config.ts in the current working directory.
boolean
Emit a machine-readable JSON envelope instead of the default TTY output.
boolean
Quiet mode — suppresses all output except errors.
boolean
Verbose output — includes additional metadata and timings.

Target resolution

migration show resolves the target argument in the following order:
  1. Path — if the argument contains a / or \, it is treated as a directory path and that package is read directly.
  2. Hash prefix — otherwise the argument is matched as a prefix against the migrationHash field of every attested migration. Matching follows the same git-style prefix semantics: the prefix must be long enough to be unambiguous; if more than one migration matches, the command exits with an error.
  3. Default (no argument) — the latest migration in the graph (the migration whose end-contract hash matches no other migration’s start-contract hash) is used.

What it displays

Operations with class badges

Each operation is listed with a badge indicating its class:

DDL preview

For SQL targets, each operation includes a DDL preview showing the exact SQL statement that will be executed. This lets you review the migration’s effect before applying it.

Destructive warnings

When a migration contains one or more destructive operations, the output includes a prominent warning banner:
Destructive operations such as DROP TABLE, DROP COLUMN, or ALTER COLUMN TYPE cannot be rolled back once applied. Always review migrations containing destructive operations before applying them to a production database.

Example output

TTY:

JSON output format