migration status
Show the Prisma ORM migration path and pending status.
migration status shows which migrations are pending between the database marker and the target contract.
Use it before and after db migrate, and when debugging why an environment is not at the expected contract state.
Usage
bunx prisma@latest migration status --db "$DATABASE_URL"Options
| Option | What it does |
|---|---|
--db <url> | Connects to the database. |
--space <id> | Narrows output to a single contract space. |
--to <contract> | Sets the target contract reference (hash, prefix, ref name, migration directory name, <dir>^, or ./path). |
--from <contract> | Sets the origin contract reference. With --from, the command computes the path offline and does not need a database. |
--legend | Prints a key for the tree glyphs and lane colors. |
--ascii | Uses ASCII glyphs (pipe-friendly). |
--config <path> | Read this config file instead of ./prisma.config.ts. |
--json | Prints a machine-readable result. |
Examples
bunx prisma@latest migration status --db "$DATABASE_URL"
bunx prisma@latest migration status --to production
bunx prisma@latest migration status --from abc123 --to production
bunx prisma@latest migration status --asciiReading the result
With --db, status compares the on-disk migration packages to what has been applied in the database. With --from, it computes the path offline instead, without a database.
The migration group has three more read-only views: migration graph for topology, migration log for executed history, and migration list for on-disk enumeration. Run each with --help for details.
Use db verify after applying migrations to check the final database shape against the emitted contract.
