Documentation Index
Fetch the complete documentation index at: https://mintlify.com/prisma/prisma-next/llms.txt
Use this file to discover all available pages before exploring further.
prisma-next db update applies the full set of operations required to bring any database — whether bootstrapped with db init or not — into alignment with the currently emitted contract.json. Unlike db init, it permits widening and destructive operations in addition to purely additive ones.
db update creates the signature table if it is missing, so it can operate on databases that have never been touched by Prisma Next. In --dry-run mode for SQL targets, it prints a DDL preview derived from the planned operations so you can review the exact statements before committing.
Options
Database connection string. Optional when
db.connection is set in your config file.Path to
prisma-next.config.ts. Defaults to ./prisma-next.config.ts in the current working directory.Print the migration plan and, for SQL targets, a DDL preview of the planned operations. No changes are applied.
Skip confirmation prompts. Required when running in non-interactive mode with a destructive plan.
Override automatic TTY detection. Use
--no-interactive to force non-interactive mode in environments that report an interactive terminal but should not receive prompts.Output a JSON result envelope to stdout.
Quiet mode. Suppresses all output except errors.
Verbose mode. Prints debug information and timing data.
Config requirements
db update requires a driver entry in your config to open a database connection. A contract entry must point to a valid emitted contract.json. The driver field is not needed if you only use --dry-run, but it is always required for an apply.
prisma-next.config.ts
Usage examples
Dry-run DDL preview
When--dry-run is passed against a SQL target, db update prints a DDL preview alongside the operation plan. This lets you see the exact SQL statements that would be executed before committing to an apply.
TTY — dry-run with DDL preview
Differences from db init
db init | db update | |
|---|---|---|
| Operation classes | Additive only | Additive, widening, destructive |
| Existing marker required | No (fails if marker hash mismatches) | No (creates signature table if missing) |
| Per-operation runner checks | Enabled | Disabled by default |
| Destructive confirmation | N/A | Required (interactive prompt or -y) |
| Primary use case | Fresh database bootstrap | Ongoing schema evolution |
Error codes
| Code | Meaning |
|---|---|
PN-CLI-4005 | Missing database connection. Provide --db <url> or set db.connection in config. |
PN-CLI-4010 | Missing driver in config. Add a driver descriptor to your config. |
RUNNER_FAILED | The runner rejected the apply due to an origin mismatch, failed checks, policy failures, or execution errors. |