db update
Update a database to match the current Prisma 8 contract.
db update compares the live database with the emitted contract and applies the changes that close the gap, whether or not the database was bootstrapped with db init.
Use it for direct reconciliation when you do not need a checked-in migration package.
Usage
bunx prisma@latest db update --db "$DATABASE_URL"Options
| Option | What it does |
|---|---|
--db <url> | Connects to the database. |
--dry-run | Shows planned operations without applying them. |
--to <contract> | Updates to a specific contract (hash, prefix, ref name, migration directory name, or ./path). |
--advance-ref <name> | Advances the named ref to the post-command contract hash. |
--config <path> | Read this config file instead of ./prisma.config.ts. |
--json | Prints a machine-readable result. |
Destructive changes need consent
An operation that would destroy data is applied only with your consent: the command asks you to type the database name. In a CI job or a run with --no-interactive, where the command cannot ask, pass the consent as --confirm <database> instead:
bunx prisma@latest db update --db "$DATABASE_URL" --no-interactive --confirm appdbRecommended flow
bunx prisma@latest contract emit
bunx prisma@latest db update --db "$DATABASE_URL" --dry-run
bunx prisma@latest db update --db "$DATABASE_URL"
bunx prisma@latest db verify --db "$DATABASE_URL"Use --dry-run before applying changes in shared environments.
When to use migrations instead
For reviewable database changes in version control, use migration plan and db migrate.
Use db update for local development, preview environments, and workflows where direct reconciliation is acceptable.
