Skip to main content
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.
Destructive operations — such as dropping columns or tables — require explicit confirmation. In interactive terminals, db update prompts before applying any destructive plan. In non-interactive environments (CI, scripts), the command fails unless you pass -y / --yes. This is intentional to prevent accidental data loss.

Options

string
Database connection string. Optional when db.connection is set in your config file.
string
Path to prisma-next.config.ts. Defaults to ./prisma-next.config.ts in the current working directory.
boolean
Print the migration plan and, for SQL targets, a DDL preview of the planned operations. No changes are applied.
boolean
Skip confirmation prompts. Required when running in non-interactive mode with a destructive plan.
boolean
Override automatic TTY detection. Use --no-interactive to force non-interactive mode in environments that report an interactive terminal but should not receive prompts.
string
Output a JSON result envelope to stdout.
boolean
Quiet mode. Suppresses all output except errors.
boolean
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

Error codes