Skip to Content
Zenlev
Guides

Bootstrap and cutover

Establish a verified starting state for existing and empty databases.

A migration ledger describes changes from a known starting state. Decide how each database reaches that state before switching its deployment runner.

Zenlev can coexist with retained Prisma history while recording future Zenlev changes in its own ledger.

Existing database

  1. Back up the database using your existing operating procedures.
  2. Compare the current ZModel against the live database with zenlev db push --dry-run --sql.
  3. Reconcile any drift through reviewed changes.
  4. Stop invoking Prisma's migration runner for future deployments.
  5. Configure a dedicated Zenlev ledger and retain existing Prisma bookkeeping.
  6. Author the first incremental Zenlev migration from the verified current state.
  7. Inspect its plan and apply it through the deployment workflow.

Zenlev starts a new ledger. Historical Prisma SQL files and checksums retain their existing meaning in the project's historical record.

A fresh empty Zenlev ledger on an existing database requires incremental changes. Running an initial create-all migration there would attempt to recreate existing objects.

Record the verified baseline, cutover revision, and first Zenlev migration in your project's operating documentation. This gives future operators the starting state they need to interpret the new history.

Empty database

Keep a reviewed bootstrap path for new environments.

For a fresh project, compare the initial ZModel against the empty database and generate an initial migration.

bun run zenlev db push --dry-run --sql
bun run zenlev db push --create-migration --name initial_schema --format
bun run zenlev migrate apply --plan-only
bun run zenlev migrate apply

For a project adopted after Prisma, provision the historical schema through your approved baseline or restore workflow, then run the new Zenlev ledger.

Keep fresh-environment bootstrap and existing-environment cutover explicit in deployment documentation.

Repeat the workflow per environment

Use an environment-aware factory to select the intended database. Verify its baseline before applying the same migration graph.

Development, staging, and production can have different applied histories at a given moment. Their ledgers determine eligible work on each destination.

Use Namespaces and environments for destination selection and Staged deployments for release stages. Review dialect-specific connection setup in the Dialect examples.

On this page