Prisma Next is in early access.Read the docs

prisma-next db init

Initialize a database from the current Prisma Next contract.

prisma-next db init creates missing database structures from the current emitted contract and signs the database.

Use it for first setup of a database that should match your current contract.

Usage

prisma-next db init --db "$DATABASE_URL"

Options

OptionWhat it does
--db <url>Connects to the database.
--config <path>Reads a specific prisma-next.config.ts file.
--dry-runShows planned operations without applying them.
--jsonPrints a machine-readable result.

Behavior

db init is intended for bootstrap work. It creates missing structures needed by the contract and writes the contract marker after the database matches.

Run a dry run first when you are not working with a disposable local database:

prisma-next db init --db "$DATABASE_URL" --dry-run

Examples

prisma-next contract emit
prisma-next db init --db "$DATABASE_URL"
prisma-next db verify --db "$DATABASE_URL"
prisma-next db init --db "$DATABASE_URL" --dry-run --json

When to use db update instead

Use prisma-next db update when the database already exists and you want Prisma Next to reconcile it with a changed contract. Use prisma-next migration plan when you want a reviewable migration package in version control.

On this page