Skip to main content
prisma-next migration status shows the full migration graph and, when given a database connection, marks which migrations have been applied and which are still pending. Without a database connection the command works entirely offline, rendering the graph structure from disk. All named refs stored in migrations/refs.json are overlaid on the graph regardless of mode, giving you a complete picture of where each environment sits relative to the migration history.

Options

string
Database connection string. When provided, the command enters online mode: it reads the current database marker and shows applied/pending status. Defaults to config.db.connection if set.
string
Target a named ref from migrations/refs.json instead of the contract hash. The active ref is highlighted in bold; other refs are dimmed. In ref mode, the CONTRACT.AHEAD warning is suppressed.
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 graph metadata and timings.

Online vs offline mode

migration status adapts its output based on whether a database connection is available. Without --db (offline mode): Reads migration packages from disk and renders the graph structure. Useful for reviewing migration history in CI or on machines without database access. Contract and ref markers are still shown. With --db (online mode): Connects to the database, reads the current marker hash, and annotates the graph with applied/pending status. Shows the distance from the current database position to the ref or contract target (e.g., “2 edge(s) behind ref”).

Graph display markers

The graph uses the following inline markers to show context at each node: Each migration edge also shows a summary of its operation count and, when the migration contains destructive operations, a highlighted warning. Example output (online mode):

Branched graphs and AMBIGUOUS_TARGET

When the migration graph has multiple branches (two or more migrations share the same starting contract hash), the command cannot automatically determine a single target without additional guidance:
Resolve ambiguity by using --ref to point status at a named ref that sits on a specific branch, or by running migration ref set to assign refs to each branch.

Ref mode and CONTRACT.AHEAD suppression

When --ref is provided, the command uses the ref’s hash as the target instead of the contract hash. This suppresses the CONTRACT.AHEAD warning that would otherwise appear when contract.json is ahead of the ref target — in multi-environment workflows, the contract being ahead of a ref is expected and not an error.
The active ref is rendered in bold in the graph; other refs are dimmed to keep the focus on the environment you are inspecting.

Examples

JSON output format