[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-prisma-prisma-next-migrations":3,"mdc-8efod7-key":35,"related-repo-prisma-prisma-next-migrations":9557,"related-org-prisma-prisma-next-migrations":9646},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":11,"stars":23,"repoUrl":24,"updatedAt":25,"license":26,"forks":27,"topics":28,"repo":31,"sourceUrl":33,"mdContent":34},"prisma-next-migrations","author and manage Prisma Next migrations","Author Prisma Next migrations — choose db update vs migration plan, edit the framework-rendered migration.ts (replace placeholder sentinels with dataTransform closures), recover from MIGRATION.HASH_MISMATCH or PN-MIG-2001 unfilled placeholder. Use for prisma migrate dev, prisma migrate deploy, prisma db push, db update, db update --dry-run, migration plan, migrate, migration new, migration show, db verify, db sign, data migration, this.dataTransform, dataTransform, placeholder, generated migration.ts, edit migration.ts, MIGRATION.HASH_MISMATCH, schema drift.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},"prisma","Prisma","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Fprisma.png",[12,16,19,22],{"name":13,"slug":14,"type":15},"TypeScript","typescript","tag",{"name":17,"slug":18,"type":15},"Database","database",{"name":20,"slug":21,"type":15},"Migration","migration",{"name":9,"slug":8,"type":15},415,"https:\u002F\u002Fgithub.com\u002Fprisma\u002Fprisma-next","2026-07-24T05:37:13.469138",null,15,[29,30],"loggy-core","loggy-terminal",{"repoUrl":24,"stars":23,"forks":27,"topics":32,"description":26},[29,30],"https:\u002F\u002Fgithub.com\u002Fprisma\u002Fprisma-next\u002Ftree\u002FHEAD\u002Fskills\u002Fprisma-next-migrations","---\nname: prisma-next-migrations\ndescription: Author Prisma Next migrations — choose db update vs migration plan, edit the framework-rendered migration.ts (replace placeholder sentinels with dataTransform closures), recover from MIGRATION.HASH_MISMATCH or PN-MIG-2001 unfilled placeholder. Use for prisma migrate dev, prisma migrate deploy, prisma db push, db update, db update --dry-run, migration plan, migrate, migration new, migration show, db verify, db sign, data migration, this.dataTransform, dataTransform, placeholder, generated migration.ts, edit migration.ts, MIGRATION.HASH_MISMATCH, schema drift.\n---\n\n# Prisma Next — Migration Authoring\n\n> **Edit your data contract. Prisma Next plans the migration. You fill in any data transforms.**\n\nThe three-step user model:\n\n1. **You edit your data contract.** (`prisma-next-contract`)\n2. **Prisma Next plans the migration for you.** ← this skill\n3. **If a data transform is needed, you edit `migration.ts` and self-emit.** ← this skill\n\nOnce the contract changes, you choose how the change reaches the database. This skill covers the two paths (`db update` and `migration plan` + `migrate`), the migration-package contract, the `migration.ts` authoring API, and the failure modes you recover from without leaving the loop.\n\n**Targets.** Migration authoring is first-class for **Postgres** and **Mongo**. The CLI reads the target from `prisma-next.config.ts` (set during `prisma-next init --target …`). Migration commands do not accept a `--target` flag — use a config scoped to the target you need. Examples below call out target-specific imports, markers, factories, and transaction behavior where they diverge.\n\n## When to Use\n\n- User edited the contract and wants to apply the change to the DB.\n- User wants to author a migration with a data transform.\n- User wants to run pending migrations against a local DB.\n- User hit `MIGRATION.HASH_MISMATCH`, `PN-MIG-2001` (unfilled placeholder), or a partially-applied migration.\n- User mentions: *migrate, migration, db push, db update, `prisma migrate dev`, `prisma migrate deploy`, drift, hash mismatch, data backfill*.\n\n## When Not to Use\n\n- User wants to know what migrations *will run on deploy* \u002F on merge, or to manage refs and invariants → `prisma-next-migration-review`.\n- User wants to edit the contract → `prisma-next-contract`.\n- User wants a deeper read of a single structured error envelope → `prisma-next-debug`.\n\n## Key Concepts\n\n- **`db update` (quick path).** Reads the emitted contract, diffs against the live DB, applies the change. Optional `--dry-run` prints the plan without executing. Interactive destructive-op confirmation (or `-y` to auto-accept). **Writes no migration directory.** Operations needing data transforms are not handled by this path — `db update` excludes the `data` operation class entirely and short-circuits where a data transform would be required. Use only against a database that has no shared history with anyone else (your local dev DB).\n- **`migration plan` (formal path).** Reads the emitted contract, diffs against the head of the on-disk migration graph, writes a new migration package under `migrations\u002Fapp\u002F\u003CYYYYMMDDTHHMM>_\u003Csnake_slug>\u002F`. If any operation needs a data transform, the package's `migration.ts` contains `placeholder(...)` calls you fill in.\n- **The `app\u002F` segment in migration paths is the consuming application's contract-space id.** Every migration *you* author lives under `migrations\u002Fapp\u002F`. Extensions your contract depends on get their own sibling directories (`migrations\u002F\u003Cextension-space-id>\u002F`) — those are managed by the extension package and you don't write into them. The `app\u002F` segment lands automatically the first time you run `migration plan` \u002F `db init` against an app-level config.\n- **Migration package files** (inside each `migrations\u002Fapp\u002F\u003Cdir>\u002F`):\n  - `migration.json` — manifest (metadata + `migrationHash`).\n  - `ops.json` — canonical operation list. Content-addressed; `migrationHash` is computed over this.\n  - `migration.ts` — TypeScript authoring source, **framework-rendered** by `migration plan` (or `migration new`). You edit specific holes in it (see *Fill a placeholder* below) and re-emit `ops.json` \u002F `migration.json` by running it.\n- **Contract snapshots.** `migration.ts` imports its bookend contracts from the shared, content-addressed store at `migrations\u002Fsnapshots\u002F\u003Chex>\u002Fcontract.json` + `contract.d.ts` (`\u003Chex>` is the contract's 64-hex storage hash) — not from files inside the migration package.\n- **Self-emit.** Running `node migrations\u002Fapp\u002F\u003Cdir>\u002Fmigration.ts` regenerates `ops.json` and `migration.json` from the (possibly edited) TS source. This is the only supported way to update an existing migration package after edits.\n- **`migration.ts` shape.** Framework-rendered. A class extending `Migration` (from `@prisma-next\u002Ffamily-mongo\u002Fmigration` on Mongo, or re-exported via `@prisma-next\u002Fpostgres\u002Fmigration` on Postgres — see the framing block below), with an `operations` getter that returns an array of factory-call values. The file ends with `MigrationCLI.run(import.meta.url, M)` so executing it self-emits.\n- **`placeholder(slot)`.** A sentinel the planner emits into the rendered `migration.ts` (from `@prisma-next\u002Ferrors\u002Fmigration` on Mongo, or the `@prisma-next\u002Fpostgres\u002Fmigration` import on Postgres) wherever a data transform is needed. Calling `placeholder(...)` at emit time throws `PN-MIG-2001` *Unfilled migration placeholder*. The user replaces the `() => placeholder(...)` arrow with a real query-plan closure (Postgres) or fills `dataTransform({ check, run })` sources (Mongo — see *Fill a placeholder*), then self-emits.\n- **`this.dataTransform(endContract, name, { check, run })`.** The data-transform factory. `check` is a rowset query whose presence-of-any-row signals \"work remains\"; `run` is one or more mutation queries that perform the backfill. Both are lazy closures returning query-plans built against `endContract`. The runner wraps `check` as `EXISTS(...)` for precheck and `NOT EXISTS(...)` for postcheck, so the same closure asserts both \"there is work\" and \"the work is done\".\n- **`pendingPlaceholders`.** A boolean field on the JSON result of `migration plan`. `true` means the package was written but contains unfilled placeholders — `migrate` will throw `PN-MIG-2001` until you edit `migration.ts` and self-emit.\n- **`migrationHash`.** Content-addressed identity of a migration package. `MIGRATION.HASH_MISMATCH` fires when the stored hash in `migration.json` disagrees with the hash recomputed from the on-disk files (almost always: someone edited `migration.ts` without self-emitting).\n- **Marker.** Records \"this database is at contract hash X for space Y\". **Postgres:** a row in `prisma_contract.marker`. **Mongo:** a document in the `_prisma_migrations` collection (keyed by space). Each successful migration advances the marker once schema verification passes for that space. `db sign` writes the marker from the current contract hash, but only after a schema-verification pass succeeds (it will not sign a database whose live schema disagrees with the contract).\n- **Apply atomicity.** **Postgres:** each migration runs inside `BEGIN ... COMMIT`; on failure, Postgres rolls back and the marker stays at the previous migration's `to` hash. **Mongo:** DDL ops (`createCollection`, `createIndex`, `collMod`, `setValidation`, …) are not wrapped in a multi-document transaction; the runner applies ops, verifies the live schema against the destination contract, and advances the marker only on verify-pass (resumable across spaces — see the MongoDB family doc). Ordinary DDL + `dataTransform` flows stay consistent; partial state from failed mid-migration runs is diagnosed with `db verify` \u002F `db schema`, not assumed away.\n- **Operation classes.** Every operation declares an `operationClass`: `additive`, `widening`, `data`, or `destructive`. The CLI surfaces these in the plan preview and in JSON output. There is no `long-running` class and the framework does not emit `CREATE INDEX CONCURRENTLY` — operations stay transactional.\n\n## `migration.ts` is framework-rendered, not hand-authored\n\nFiles under `migrations\u002F\u003Cspace-id>\u002F\u003Ctimestamp>\u002Fmigration.ts` (for your own app, `\u003Cspace-id>` is always `app\u002F`) are **rendered for you** by the framework — `prisma-next migration plan` writes a populated package whenever the contract changes, and `prisma-next migration new` writes an empty scaffold when you want to author operations directly. You do not write these files from scratch. You edit specific holes the framework leaves behind — chiefly replacing `placeholder(\"\u003Cslot>\")` sentinels (Postgres) or filling `dataTransform({ check, run })` pipeline slots (Mongo) — then self-emit.\n\n**Postgres** rendered imports point at `@prisma-next\u002Fpostgres\u002Fmigration` (or `@prisma-next\u002Fsqlite\u002Fmigration` for SQLite projects).\n\n**Mongo** rendered imports use `@prisma-next\u002Ffamily-mongo\u002Fmigration` for the `Migration` base class and `@prisma-next\u002Ftarget-mongo\u002Fmigration` for operation factories (`createIndex`, `dataTransform`, …). `MigrationCLI` comes from `@prisma-next\u002Fcli\u002Fmigration-cli`.\n\nTreat the rendered import lines as framework-managed on both targets:\n\n- Leave them where they are. Don't rewrite them to a different `@prisma-next\u002F\u003C…>` path; the framework's renderer is the authoritative shape and any change you make by hand will be reverted (and may trip `MIGRATION.HASH_MISMATCH`) the next time the package is re-rendered or self-emitted.\n- If you need an additional factory symbol, **add it to the existing rendered import line** (Postgres: `@prisma-next\u002Fpostgres\u002Fmigration`; Mongo: `@prisma-next\u002Ftarget-mongo\u002Fmigration`) rather than introducing a second import from a different `@prisma-next\u002F...` subpath.\n- The \"user code imports only from `@prisma-next\u002F\u003Ctarget>`\" convention applies to *your* own modules (queries, runtime setup, contract authoring). The framework-rendered `migration.ts` scaffold is the framework's surface, not yours; the rule is suspended for that one file.\n\n## Diagnostic codes you route on\n\n| Code | Source | Move |\n|---|---|---|\n| `PN-MIG-2001` *Unfilled migration placeholder* | Throwing `placeholder(...)` at emit time | Open `migration.ts`, replace the named `placeholder(\"\u003Cslot>\")` call with the real query closure, self-emit. |\n| `PN-MIG-2002` *migration.ts not found* | Reading a migration package | The package is malformed. Recover from version control, or run `prisma-next migration new` for a fresh one. |\n| `PN-MIG-2003` *invalid default export* | Loading `migration.ts` | The file's default export is not a `Migration` subclass or factory function. Restore the planner-emitted scaffold from version control or re-run `migration plan` for a clean package. |\n| `PN-MIG-2005` *dataTransform contract mismatch* | Building a data-transform query plan | The query builder was instantiated with a contract reference different from the `endContract` passed to `this.dataTransform(...)`. Use the `endContract` imported at module scope for both. |\n| `MIGRATION.HASH_MISMATCH` *Migration package is corrupt* | `migrate` (or any read of the package) | `ops.json` \u002F `migration.json` were edited without self-emitting. Run `node migrations\u002Fapp\u002F\u003Cdir>\u002Fmigration.ts` to re-emit, then re-run `migrate`. |\n| `PN-RUN-3002` *Hash mismatch* | `db verify` | The marker disagrees with the contract hash (**Postgres:** `prisma_contract.marker`; **Mongo:** `_prisma_migrations`). The DB is at a different contract version than the code thinks. Either run a migration forward, or — if the DB is correct and the marker is stale after a manual fix-up — run `db sign`. |\n| `PN-RUN-3001` *Database not signed* | Any command needing a marker | The DB has no marker yet. Run `prisma-next db init --db \u003Curl>` to baseline an empty database, or `db update --db \u003Curl>` to apply the current contract directly. |\n\n## Decision — which path do you take?\n\n| Situation | Path | Why |\n|---|---|---|\n| Local dev, schema in flux | `db update` | Fast, interactive, no migration files. |\n| Shared branch with other developers | `migration plan` + `migrate` | Replayable, reviewable, content-hashed. |\n| Anything reaching production | `migration plan` + `migrate` | Production must run a reviewed, hashed migration. |\n| Adding a column that needs a backfill | `migration plan` (writes `placeholder`), edit `migration.ts`, self-emit, then `migrate` | `db update` does not author data transforms; the formal path does. |\n| Recovering from drift (DB diverged from contract) | `db sign` after manual fix, *or* `migration plan` if PN can plan the fix | Depends on which side is right. See *Recover from drift* below. |\n\n## Dev → ship transition (the `db` ref pattern)\n\nExample — iterate locally with `db update`, then publish the first real migration:\n\n```bash\npnpm prisma-next db init --db $DATABASE_URL\npnpm prisma-next contract emit && pnpm prisma-next db update --db $DATABASE_URL\npnpm prisma-next contract emit && pnpm prisma-next migration plan --name add_feature\npnpm prisma-next migrate --db $DATABASE_URL\npnpm prisma-next db verify --db $DATABASE_URL\n```\n\nThe `db` ref is a named pointer at `migrations\u002Fapp\u002Frefs\u002Fdb.json` — just `{ hash, invariants }`. It records which contract hash the project's dev database has been brought up to — the offline planner's stand-in for \"where is my local DB?\" without opening a connection at plan time. The contract it names resolves through the shared content-addressed store at `migrations\u002Fsnapshots\u002F\u003Chex>\u002Fcontract.json` by that hash, the same store every migration graph node resolves through.\n\n**What `db init` \u002F `db update` write.** When run against the project's default `--db` URL (no explicit `--db` flag), both commands implicitly advance the `db` ref: they write-if-absent the post-command contract IR into the snapshot store, then write the ref's pointer. Override the ref name with `--advance-ref \u003Cname>`. When you pass `--db \u003Cnon-default-url>`, ref advancement is suppressed unless `--advance-ref` is explicit — reconciling a different database is not the same as checkpointing this project's dev state.\n\nThe on-disk layout is just the pointer:\n\n```text\nmigrations\u002Fapp\u002Frefs\u002F\n└── db.json                 # { \"hash\": \"\u003Chex>\", \"invariants\": [] }\n```\n\n**First `migration plan` after dev iteration.** `migration plan` defaults `--from` to the `db` ref. When the on-disk migration graph is still **empty** and the `db` ref points at a non-null hash with a store entry (typical after one or more `db update` cycles), the planner emits **two** bundles instead of one:\n\n1. Baseline: `null → from-hash` (introduces `from-hash` as a graph node)\n2. Delta: `from-hash → current_contract`\n\nBoth land on disk in one invocation — expect two new directories in `git status`. `migrate` then finds a path through the baseline and applies the delta. This closes the dev → ship trap where a single-bundle plan referenced a hash that was not yet a graph node and produced an unapplyable migration (`MIGRATION.PATH_UNREACHABLE` at apply time).\n\n**The forgot-the-flag pitfall.** After the graph is **non-empty**, the default `db` ref may point **past the graph tip** (the ref advanced on every `db update` while you iterated, but you never committed migrations). The next implicit-default `migration plan` refuses with `MIGRATION.HASH_NOT_IN_GRAPH` and names reachable refs that point at graph nodes.\n\nRecovery when you see `MIGRATION.HASH_NOT_IN_GRAPH` on plan:\n\n```bash\n# Option A — plan from a graph node explicitly\npnpm prisma-next migration plan --from production --name my_change\n\n# Option B — realign the db ref to a graph-node hash, then plan with the default\npnpm prisma-next ref set db \u003Cgraph-node-hash>\npnpm prisma-next migration plan --name my_change\n```\n\nIf the `db` ref's pointer is itself missing and the hash isn't a graph node either (`MIGRATION.SNAPSHOT_MISSING`), create it with `ref set db \u003Chash>` or advance it with `db update --advance-ref db`.\n\n**After plain `migrate`.** `migrate` does not implicitly advance the `db` ref (production-shaped commands stay explicit). The live marker advances while the ref may lag. Refresh with `db update` (no-op on DB when already current) or `migrate --advance-ref db` in the same invocation.\n\n**When to switch paths.** Use `db update` while the schema is in flux on a solo dev database. Switch to `migration plan` + `migrate` when the change needs a reviewable, replayable migration — typically before opening a PR or touching any shared environment. The `db` ref bridges the two: it captures dev iteration state on disk so the first formal plan knows where you left off.\n\n**Graph-node rule (plan time).** Any hash used as a `from` end — explicit `--from`, default `db` ref, or ref name — must already be a node in the on-disk migration graph once the graph is non-empty. The auto-baseline two-bundle emission is the one exception: it applies only on an **empty** graph with a non-null ref-resolved `from` and an available store entry. If the ref's pointer is missing and the hash isn't a graph node either, plan refuses with `MIGRATION.SNAPSHOT_MISSING` instead.\n\n**Apply-time complement.** `migrate` reads the live marker before DDL. If the marker hash is not a graph node, the command refuses with `MIGRATION.MARKER_MISMATCH` — catching drift the offline planner cannot see. This is separate from `MIGRATION.MARKER_NOT_IN_HISTORY`, which fires later during the runner's graph walk when the marker is off the path being traversed. See `prisma-next-migration-review` for the full diagnostic catalog.\n\n`db` is a **default ref name**, not a reserved one. The framework overwrites it on the next dev cycle; you may `ref set db \u003Chash>` explicitly and accept that a subsequent `db update` replaces it when run against the default URL.\n\nCanonical detail: [Migration System § Contract resolution through the snapshot store](..\u002F..\u002Fdocs\u002Farchitecture%20docs\u002Fsubsystems\u002F7.%20Migration%20System.md#contract-resolution-through-the-snapshot-store), [§ `migration plan`](..\u002F..\u002Fdocs\u002Farchitecture%20docs\u002Fsubsystems\u002F7.%20Migration%20System.md#migration-plan), [§ Recovery affordances](..\u002F..\u002Fdocs\u002Farchitecture%20docs\u002Fsubsystems\u002F7.%20Migration%20System.md#recovery-affordances), [ADR 218 — Refs with paired contract snapshots and universal graph-node invariant](..\u002F..\u002Fdocs\u002Farchitecture%20docs\u002Fadrs\u002FADR%20218%20-%20Refs%20with%20paired%20contract%20snapshots%20and%20universal%20graph-node%20invariant.md) (TML-2629, its paired-snapshot part superseded — see the ADR's Status note), and [ADR 240 — Contract snapshots live in a content-addressed store](..\u002F..\u002Fdocs\u002Farchitecture%20docs\u002Fadrs\u002FADR%20240%20-%20Contract%20snapshots%20live%20in%20a%20content-addressed%20store.md).\n\n## Workflow — `db update` (quick path)\n\nThe concept: `db update` resolves the destination (`emitted contract`) against the live DB and applies the difference. Preview with `--dry-run`. Destructive ops prompt interactively unless you pass `-y` or `--no-interactive`. The path excludes operations of the `data` class entirely — if the diff requires a data transform, `db update` fails with a planning error and you switch to `migration plan` to author the transform.\n\nRun after a contract edit:\n\n```bash\npnpm prisma-next contract emit\n# Postgres: --db postgresql:\u002F\u002F...\n# Mongo:    --db mongodb:\u002F\u002F...  (dev scaffolds often need ?replicaSet=rs0)\npnpm prisma-next db update --db $DATABASE_URL --dry-run\npnpm prisma-next db update --db $DATABASE_URL\n```\n\n`db update` already verifies schema and advances the marker on success — a follow-up `db verify` is redundant on the happy path. Use `db verify` only when you need a standalone diagnostic (see *Verify contract vs DB*).\n\nInspect the JSON output to drive the next move:\n\n```bash\npnpm prisma-next db update --db $DATABASE_URL --json\n```\n\nThe JSON contains `plan.operations[]` with each `operationClass`, plus (in apply mode) `execution.operationsExecuted` and the post-apply `marker.storageHash`. If the command failed because of destructive operations, the error envelope's `meta.destructiveOperations[]` lists exactly what would have been dropped.\n\n## Workflow — `migration plan` + `migrate` (formal path)\n\nThe concept: `migration plan` writes a new migration package on disk. If the planner needed any data transforms, the package is *pending* — `migration.ts` holds `placeholder(...)` calls until you fill them in. `migrate` runs every pending package in graph order, transactionally.\n\nPlan a change:\n\n```bash\npnpm prisma-next contract emit\npnpm prisma-next migration plan --name \u003Csnake_slug>\n```\n\nRead the result. The JSON shape exposes the queryable signals:\n\n- `dir` — the path of the new package (e.g. `migrations\u002Fapp\u002F20260515T1200_add_user_email\u002F`).\n- `pendingPlaceholders` — `true` if `migration.ts` still contains `placeholder(...)` calls.\n- `operations[].operationClass` — for spotting `destructive` and `data` ops.\n- `preview.statements` — family-agnostic textual preview.\n\nInspect the package:\n\n```bash\npnpm prisma-next migration show\npnpm prisma-next migration show \u003CdirName-or-migrationHash-prefix>\n```\n\n`migration show` displays a single migration package. To see the ordered list of migrations that would run — across all contract spaces — use `migrate --show`:\n\n```bash\n# Online: reads the live DB marker as the origin.\npnpm prisma-next migrate --show --db $DATABASE_URL\n\n# Offline: hypothetical path from any ref or hash.\npnpm prisma-next migrate --show --from \u003Chash-or-ref> --to \u003Chash-or-ref>\n```\n\n`migrate --show` is read-only and never writes to the DB or the migration graph. Use it before applying to confirm the execution order.\n\nFill in any data transforms (see *Fill a placeholder*), self-emit if you edited `migration.ts`, then:\n\n```bash\npnpm prisma-next migrate --db $DATABASE_URL\n```\n\n`migrate` runs without prompting — destructive-op confirmation lives on `db update`, not here. Review destructive ops in the plan output or in `migration show` *before* applying.\n\n## Workflow — Fill a placeholder\n\nThe concept: the planner can detect *that* a data transform is needed but not *what* it should do. It writes a typed scaffold and stops; you fill the transform, then self-emit.\n\n### Postgres\n\nThe planner can detect *that* a data transform is needed (e.g. backfilling a new `NOT NULL` column with no default) but not *what* it should do. You fill `check` and `run` closures with real query plans built against `endContract`.\n\nThe scaffold the planner emits looks like:\n\n```typescript\n\u002F\u002F migrations\u002Fapp\u002F20260515T1200_add_user_name\u002Fmigration.ts\nimport endContract from '..\u002F..\u002Fsnapshots\u002F93f07d1b…c9e1e5a2\u002Fcontract.json' with { type: 'json' };\nimport { Migration, MigrationCLI, addColumn, placeholder } from '@prisma-next\u002Fpostgres\u002Fmigration';\n\nexport default class M extends Migration {\n  override get operations() {\n    return [\n      addColumn('public', 'user', {\n        name: 'name',\n        typeSql: 'text',\n        defaultSql: '',\n        nullable: true,\n      }),\n      this.dataTransform(endContract, 'backfill user.name', {\n        check: () => placeholder('backfill user.name:check'),\n        run:   () => placeholder('backfill user.name:run'),\n      }),\n    ];\n  }\n}\n\nMigrationCLI.run(import.meta.url, M);\n```\n\nReplace both `placeholder(...)` calls with query-plan closures built from `endContract`. The `check` closure must return a **rowset query whose presence of any row signals \"work remains\"** — conventionally `\u003Ctable>.select('id').where(\u003Cviolation predicate>).limit(1)`. Scalar\u002Faggregate shapes (`count(*)`, `bool_and(...)`) silently break the contract: the runner wraps `check` twice (`EXISTS(...)` for precheck, `NOT EXISTS(...)` for postcheck), and a query that always returns one row makes `EXISTS` always true and `NOT EXISTS` always false.\n\nBuild the query builder against `endContract` so the storage hashes line up — using a different contract reference raises `PN-MIG-2005`. The filled-in shape (the rendered scaffold above with `placeholder(...)` calls replaced; if you need an extra factory like `setNotNull`, add it to the *existing* `@prisma-next\u002Fpostgres\u002Fmigration` import line rather than authoring a second import). See `prisma-next-queries` for the surrounding `db` setup:\n\n```typescript\nimport endContract from '..\u002F..\u002Fsnapshots\u002F93f07d1b…c9e1e5a2\u002Fcontract.json' with { type: 'json' };\nimport { Migration, MigrationCLI, addColumn, setNotNull } from '@prisma-next\u002Fpostgres\u002Fmigration';\nimport { db } from '.\u002Fdb'; \u002F\u002F sql({ context: createExecutionContext({ contract: endContract, ... }) })\n\nexport default class M extends Migration {\n  override get operations() {\n    return [\n      addColumn('public', 'user', {\n        name: 'name',\n        typeSql: 'text',\n        defaultSql: '',\n        nullable: true,\n      }),\n      this.dataTransform(endContract, 'backfill user.name', {\n        check: () => db.users.select('id').where((f, fns) => fns.eq(f.name, null)).limit(1),\n        run:   () => db.users.update({ name: '' }).where((f, fns) => fns.eq(f.name, null)),\n      }),\n      setNotNull('public', 'user', 'name'),\n    ];\n  }\n}\n\nMigrationCLI.run(import.meta.url, M);\n```\n\nSelf-emit:\n\n```bash\nnode migrations\u002Fapp\u002F20260515T1200_add_user_name\u002Fmigration.ts\n```\n\nSelf-emit regenerates `ops.json` and recomputes `migrationHash` in `migration.json`. The next `migrate` will see a consistent package.\n\n### Mongo\n\nMongo `dataTransform` operations take `{ check, run }` objects whose `source` \u002F `run` return Mongo query-plan shapes (often `RawAggregateCommand` \u002F `RawUpdateManyCommand` from `@prisma-next\u002Fmongo-query-ast\u002Fexecution`). The planner may leave `placeholder(...)` inside those sources until you fill them. Every rendered `migration.ts` includes `describe()` bookends (`from` \u002F `to` contract hashes) — the Postgres examples above omit them for brevity. Import factories from `@prisma-next\u002Ftarget-mongo\u002Fmigration`:\n\n```typescript\nimport { MigrationCLI } from '@prisma-next\u002Fcli\u002Fmigration-cli';\nimport { Migration } from '@prisma-next\u002Ffamily-mongo\u002Fmigration';\nimport { createIndex, dataTransform } from '@prisma-next\u002Ftarget-mongo\u002Fmigration';\nimport { RawAggregateCommand, RawUpdateManyCommand } from '@prisma-next\u002Fmongo-query-ast\u002Fexecution';\n\nclass M extends Migration {\n  override describe() {\n    return { from: '\u003Chex>', to: '\u003Chex>', labels: ['normalize-names'] };\n  }\n\n  override get operations() {\n    return [\n      createIndex('users', [{ field: 'name', direction: 1 }]),\n      dataTransform('lowercase-user-name', {\n        check: {\n          source: () => ({\n            collection: 'users',\n            command: new RawAggregateCommand('users', [\n              { $match: { name: { $regex: '[A-Z]' } } },\n              { $limit: 1 },\n            ]),\n            meta: { target: 'mongo', storageHash: '…', lane: 'mongo-pipeline', paramDescriptors: [] },\n          }),\n        },\n        run: () => ({\n          collection: 'users',\n          command: new RawUpdateManyCommand(\n            'users',\n            { name: { $exists: true } },\n            [{ $set: { name: { $toLower: '$name' } } }],\n          ),\n          meta: { target: 'mongo', storageHash: '…', lane: 'mongo-raw', paramDescriptors: [] },\n        }),\n      }),\n    ];\n  }\n}\n\nexport default M;\nMigrationCLI.run(import.meta.url, M);\n```\n\nSelf-emit the same way: `node migrations\u002Fapp\u002F\u003Cdir>\u002Fmigration.ts`.\n\n## Workflow — Author a migration by hand\n\nThe concept: the same `Migration` class shape lets you author operations directly when the planner has nothing to plan (a custom data fix, an extension install, a baseline). Even here you don't write the file from scratch — `migration new` renders an empty package for you, and you edit the `operations` getter inside it, then self-emit.\n\n```bash\npnpm prisma-next migration new --name \u003Csnake_slug>\n```\n\nAdd factory names to the framework-rendered import line for your target (Postgres: `@prisma-next\u002Fpostgres\u002Fmigration`; Mongo: `@prisma-next\u002Ftarget-mongo\u002Fmigration`). Browse with `--help` and the import list the renderer emitted.\n\n**Postgres** factories (representative set):\n\n- Tables: `createTable`, `dropTable`.\n- Columns: `addColumn`, `dropColumn`, `alterColumnType`, `setNotNull`, `dropNotNull`, `setDefault`, `dropDefault`.\n- Constraints: `addPrimaryKey`, `addForeignKey`, `addUnique`, `dropConstraint`.\n- Indexes: `createIndex`, `dropIndex`.\n- Enums: `createEnumType`, `addEnumValues`, `renameType`, `dropEnumType`.\n- Dependencies: `createSchema`, `createExtension`, `installExtension`.\n- Raw escape hatch: `rawSql({ id, label, operationClass, target, precheck, execute, postcheck, ... })`.\n- Data transforms: `this.dataTransform(endContract, name, { check, run })` (instance method, not a free factory).\n\n**Mongo** factories (from `@prisma-next\u002Ftarget-mongo\u002Fmigration`):\n\n- Collections: `createCollection`, `dropCollection`, `validatedCollection`, `setValidation`.\n- Indexes: `createIndex`, `dropIndex`.\n- Collection options: `collMod`.\n- Data transforms: `dataTransform(name, { check, run })` (free factory; `check`\u002F`run` use Mongo query-plan shapes).\n\nSelf-emit (`node migrations\u002Fapp\u002F\u003Cdir>\u002Fmigration.ts`) after each edit.\n\n## Workflow — Inspect the live schema\n\nThe concept: `db schema` is read-only and never writes files. It prints the live schema as a tree by default or as JSON with `--json`. Use it during planning and as part of verification.\n\n```bash\npnpm prisma-next db schema --db $DATABASE_URL\npnpm prisma-next db schema --db $DATABASE_URL --json > schema.json\n```\n\nThere is no built-in filter flag — pipe the JSON through `jq` (or your favourite JSON tool) if you only want one table.\n\n## Workflow — Verify contract vs DB (diagnostic)\n\nThe concept: `db verify` is a **standalone diagnostic** — not a routine step after `db update` or `migrate` on the happy path (those commands already verify and advance the marker when they succeed). Reach for `db verify` when you suspect drift or need to prove the DB matches the contract:\n\n- Following manual SQL or ad-hoc edits outside Prisma Next.\n- When restoring a database from backup.\n- If a `migrate` fails or partially applies (especially on Mongo, where DDL is resumable rather than transaction-wrapped).\n- When `PN-RUN-3002` \u002F `PN-RUN-3001` surfaces at runtime or from another command.\n\nModes:\n\n- Default — full verification (schema + marker).\n- `--marker-only` — skip schema verification, only check the marker.\n- `--schema-only` — skip marker verification, only check schema satisfies contract.\n- `--strict` adds: schema elements not present in the contract are an error (default is \"DB may have extras\").\n\n```bash\npnpm prisma-next db verify --db $DATABASE_URL\n```\n\nOn mismatch, the error envelope names the failure mode (`PN-RUN-3002` hash mismatch, `PN-RUN-3001` marker missing, target mismatch, schema issues with structured paths).\n\n## Workflow — Re-sign the marker\n\nThe concept: `db sign` rewrites the marker to the current contract hash. Use after a manual repair where the DB is the source of truth and the marker is stale. `db sign` performs a schema-verify first and refuses to sign a DB whose schema disagrees with the contract — so a successful sign always means the schema matches and the marker is now correct.\n\n```bash\npnpm prisma-next db sign --db $DATABASE_URL\n```\n\n## Workflow — Recover from drift\n\nThe concept: drift means `db verify` reports the live DB schema doesn't match what the marker says it should be. Two valid moves, picked by which side is correct:\n\n- **The contract is right; the DB is wrong** → run a migration. Either `db update` (quick path, dev DB only) or `migration plan` + `migrate` (everywhere else).\n- **The DB is right; the contract or marker is wrong** → edit the contract to match the DB (see `prisma-next-contract`), emit, then `db sign` to refresh the marker.\n\nThe diagnostic that reveals which side is right:\n\n```bash\npnpm prisma-next db schema --db $DATABASE_URL --json\npnpm prisma-next db verify --db $DATABASE_URL --json\n```\n\nUse `db verify` to confirm which side is wrong, then re-run it after either branch until it returns `ok` with no diagnostics.\n\n## Workflow — Recover from a partially-applied migration\n\nThe concept: on **Postgres**, each migration applies inside a transaction — a mid-migration failure rolls back and the marker stays at the previous migration's `to` hash. On **Mongo**, DDL is resumable with verify-gated marker advancement; diagnose with `db verify` \u002F `db schema`, fix the failed package's `migration.ts`, self-emit, and re-run `migrate`.\n\nFailures that *can* leak partial state include: Postgres `rawSql(...)` steps outside the transaction wrapper, Mongo DDL that partially applied before verify failed, or external side-effects (calls out to other systems from a `run` closure).\n\nDiagnose:\n\n```bash\npnpm prisma-next db verify --db $DATABASE_URL --json\npnpm prisma-next db schema --db $DATABASE_URL --json\n```\n\nFix and re-run `migrate`:\n\n```bash\nnode migrations\u002Fapp\u002F\u003Cdir>\u002Fmigration.ts\npnpm prisma-next migrate --db $DATABASE_URL\n```\n\nIf the failure was an out-of-band side-effect that left external systems half-changed, repair those by hand before re-applying.\n\n## Workflow — Recover from `MIGRATION.HASH_MISMATCH`\n\nThe concept: `migrationHash` is content-addressed. A mismatch means `migration.json`'s stored hash disagrees with the hash recomputed from `ops.json` (and metadata). The cause is almost always: someone edited `migration.ts` and forgot to self-emit. The remediation is to self-emit the offending package.\n\n```bash\nnode migrations\u002Fapp\u002F\u003Cdir>\u002Fmigration.ts\npnpm prisma-next migrate --db $DATABASE_URL\n```\n\nIf self-emit itself fails (e.g. the contract has moved on and the operations no longer make sense against the migration's end contract), the package is stale. Either restore it from version control or delete it and re-plan with `migration plan`.\n\n## Workflow — Resolve a destructive-operation prompt (`db update` only)\n\nThe concept: when `db update` would drop columns or tables, it stops and asks before applying. The prompt is `db update`-specific — `migrate` does *not* prompt and runs whatever the migration package contains, so review the plan or call `migration show` before `migrate`.\n\nWhen `db update` reports destructive operations interactively, the warning lists them. The prompt is:\n\n> Apply destructive changes? This cannot be undone.\n\nRouting:\n\n- Answer yes if the data is no longer needed.\n- Answer no, then either:\n  - Re-shape the migration via `migration plan` and hand-edit `migration.ts` to preserve the data (e.g. copy-to-new-column, then drop), or\n  - Skip the destructive operation by reverting the contract change.\n\nIn non-interactive contexts (CI, `--no-interactive`, `--json`), the destructive-op response is returned as a structured error — `meta.destructiveOperations[]` lists what would have been dropped. Re-run with `-y` to auto-accept, or address each operation individually.\n\n## Common Pitfalls\n\n1. **Using `db update` against shared or production databases.** Never. The change leaves no migration history. Use `migration plan` + `migrate`.\n2. **Skipping a data transform.** Leaving `placeholder(...)` in `migration.ts` makes the next `migrate` throw `PN-MIG-2001`. Fill every placeholder slot and self-emit.\n3. **Editing `ops.json` directly.** It's the canonical artifact, not the authoring source. Edit `migration.ts`, then self-emit.\n4. **Forgetting to self-emit after editing `migration.ts`.** The next `migrate` either uses the stale `ops.json` (if you only added comments) or fails with `MIGRATION.HASH_MISMATCH` (if you changed operations). Always self-emit.\n5. **Routine `db verify` after a successful `db update` or `migrate`.** Redundant on the happy path — reserve `db verify` for drift diagnosis (manual edits, restore, failed `migrate`).\n6. **Aggregate `check` closure in Postgres `this.dataTransform`.** Returning `count(*)` or `bool_and(...)` breaks the precheck\u002Fpostcheck contract — both sides resolve to constants. Use a rowset shape: `select('id').where(\u003Cviolation>).limit(1)`.\n7. **Two contract references in one migration.** Building a query plan against a different contract than the one passed to `this.dataTransform(endContract, ...)` raises `PN-MIG-2005`. Always import `endContract` once at module scope and use the same reference.\n8. **Renaming and expecting the planner to detect it (Postgres).** Prisma Next has no in-contract rename hint today; the planner emits a destructive drop+add. Hand-edit `migration.ts` to rewrite the destructive op as a `rawSql({ ... })` that issues `ALTER TABLE ... RENAME COLUMN ...` (or use the two-migration keep \u002F backfill \u002F drop pattern), then self-emit. See `prisma-next-contract` § *Edit a field — rename*.\n9. **Hand-authoring `migration.ts` from a blank file, or rewriting the rendered import line.** Migration files are framework-rendered — let `prisma-next migration plan` (or `migration new`) render the package, then edit only the holes the framework leaves for you. On Postgres leave the rendered `@prisma-next\u002Fpostgres\u002Fmigration` (or `@prisma-next\u002Fsqlite\u002Fmigration`) import path alone; on Mongo use `@prisma-next\u002Ffamily-mongo\u002Fmigration` + `@prisma-next\u002Ftarget-mongo\u002Fmigration` as rendered. Add symbols to the existing factory import line rather than introducing new import paths.\n\n## What Prisma Next doesn't do yet\n\n- **Runtime-apply migrations.** Prisma Next doesn't apply pending migrations from your app's startup code (the \"Drizzle pattern\" for serverless \u002F edge). Workaround: run `prisma-next migrate` from your deploy pipeline before the app starts. If you need runtime-apply built-in, file a feature request via the `prisma-next-feedback` skill.\n- **Seeds-as-first-class.** Prisma Next doesn't ship a `prisma db seed` equivalent. Workaround: write a TypeScript script that imports your `db` instance and runs your setup queries; invoke it from `package.json`'s scripts. If you need first-class seeding, file a feature request via the `prisma-next-feedback` skill.\n- **Migration squashing.** Prisma Next doesn't squash older migrations into a baseline. They accumulate; for very large histories, manual baseline-and-truncate is the path. If you need built-in squashing, file a feature request via the `prisma-next-feedback` skill.\n- **In-contract rename hints.** The planner cannot detect that a field rename is a rename rather than a drop+add. Workaround: hand-edit `migration.ts` to issue a `RENAME COLUMN` via `rawSql(...)`, or use a keep \u002F backfill \u002F drop pattern across two migrations. If you need a contract-level rename hint, file a feature request via the `prisma-next-feedback` skill.\n\n## Graph and history commands\n\nAfter planning or applying, you can inspect the migration graph offline:\n\n- `pnpm prisma-next migration list` — enumerate all on-disk migrations, rendered as a graph tree. Supports `--legend` (print the glyph key), `--ascii` (pipe-safe glyphs), and `--json`.\n- `pnpm prisma-next migration log --db $DATABASE_URL` — flat chronological table of applied migrations, read from the live DB. Supports `--ascii` and `--json`.\n\nFor the full graph topology: `pnpm prisma-next migration graph` (also supports `--legend`, `--ascii`, `--dot`, `--json`).\n\n## `@@control` and DDL scope\n\nObjects whose `@@control` policy excludes them from Prisma Next's managed surface are omitted from planned DDL. The four policies are: `managed` (Prisma plans and applies DDL), `tolerated` (object may exist, no DDL emitted), `external` (object is expected to exist, no DDL), `observed` (Prisma reads but never writes). Declare `@@control(managed|tolerated|external|observed)` in your schema; see `prisma-next-contract` and [`packages\u002F2-sql\u002F2-authoring\u002Fcontract-psl\u002FREADME.md`](..\u002F..\u002Fpackages\u002F2-sql\u002F2-authoring\u002Fcontract-psl\u002FREADME.md) for authoring syntax.\n\n## Telemetry\n\nThe CLI collects anonymous usage data by default. To opt out, set `PRISMA_NEXT_DISABLE_TELEMETRY=1` or `DO_NOT_TRACK=1` in your environment. See [`docs\u002FTelemetry.md`](..\u002F..\u002Fdocs\u002FTelemetry.md) for the full opt-out reference.\n\n## Checklist\n\n- [ ] Contract emitted (`contract.json` + `contract.d.ts` current).\n- [ ] Chose the right path: `db update` (local dev) vs `migration plan` + `migrate` (anything shared).\n- [ ] For `migration plan`: ran `migration show` to review before `migrate`.\n- [ ] Filled every `placeholder(...)` in `migration.ts` (if any), built against `endContract`.\n- [ ] `check` closures are rowset queries, not scalar aggregates.\n- [ ] Self-emitted (`node migrations\u002Fapp\u002F\u003Cdir>\u002Fmigration.ts`) after editing the TS.\n- [ ] Ran `migrate` (or `db update`) and saw it complete.\n- [ ] Used `db verify` only when diagnosing drift — not as a routine post-apply step.\n- [ ] Did NOT use `db update` against a shared or production database.\n- [ ] Did NOT edit `ops.json` directly.\n- [ ] Did NOT skip a destructive-op prompt without inspecting `meta.destructiveOperations[]`.\n",{"data":36,"body":37},{"name":4,"description":6},{"type":38,"children":39},"root",[40,49,63,68,119,155,202,209,277,283,328,334,1149,1160,1226,1249,1308,1313,1397,1403,1776,1782,1975,1989,2001,2211,2245,2314,2319,2329,2395,2430,2457,2510,2522,2666,2701,2745,2782,2834,2873,2904,2951,2964,3027,3032,3135,3165,3170,3209,3253,3271,3310,3315,3382,3387,3473,3478,3543,3562,3683,3693,3711,3741,3771,3777,3796,3802,3846,3851,4528,4621,4683,5612,5617,5637,5670,5675,5773,7118,7129,7135,7161,7207,7233,7242,7451,7467,7554,7566,7572,7591,7667,7680,7686,7723,7766,7771,7812,7846,7865,7871,7889,7924,7930,7942,7999,8004,8073,8093,8099,8149,8176,8181,8250,8261,8327,8332,8343,8375,8435,8446,8459,8505,8516,8524,8529,8569,8601,8607,8957,8963,9085,9091,9096,9155,9193,9205,9275,9281,9313,9319,9551],{"type":41,"tag":42,"props":43,"children":45},"element","h1",{"id":44},"prisma-next-migration-authoring",[46],{"type":47,"value":48},"text","Prisma Next — Migration Authoring",{"type":41,"tag":50,"props":51,"children":52},"blockquote",{},[53],{"type":41,"tag":54,"props":55,"children":56},"p",{},[57],{"type":41,"tag":58,"props":59,"children":60},"strong",{},[61],{"type":47,"value":62},"Edit your data contract. Prisma Next plans the migration. You fill in any data transforms.",{"type":41,"tag":54,"props":64,"children":65},{},[66],{"type":47,"value":67},"The three-step user model:",{"type":41,"tag":69,"props":70,"children":71},"ol",{},[72,92,102],{"type":41,"tag":73,"props":74,"children":75},"li",{},[76,81,83,90],{"type":41,"tag":58,"props":77,"children":78},{},[79],{"type":47,"value":80},"You edit your data contract.",{"type":47,"value":82}," (",{"type":41,"tag":84,"props":85,"children":87},"code",{"className":86},[],[88],{"type":47,"value":89},"prisma-next-contract",{"type":47,"value":91},")",{"type":41,"tag":73,"props":93,"children":94},{},[95,100],{"type":41,"tag":58,"props":96,"children":97},{},[98],{"type":47,"value":99},"Prisma Next plans the migration for you.",{"type":47,"value":101}," ← this skill",{"type":41,"tag":73,"props":103,"children":104},{},[105,118],{"type":41,"tag":58,"props":106,"children":107},{},[108,110,116],{"type":47,"value":109},"If a data transform is needed, you edit ",{"type":41,"tag":84,"props":111,"children":113},{"className":112},[],[114],{"type":47,"value":115},"migration.ts",{"type":47,"value":117}," and self-emit.",{"type":47,"value":101},{"type":41,"tag":54,"props":120,"children":121},{},[122,124,130,132,138,140,146,148,153],{"type":47,"value":123},"Once the contract changes, you choose how the change reaches the database. This skill covers the two paths (",{"type":41,"tag":84,"props":125,"children":127},{"className":126},[],[128],{"type":47,"value":129},"db update",{"type":47,"value":131}," and ",{"type":41,"tag":84,"props":133,"children":135},{"className":134},[],[136],{"type":47,"value":137},"migration plan",{"type":47,"value":139}," + ",{"type":41,"tag":84,"props":141,"children":143},{"className":142},[],[144],{"type":47,"value":145},"migrate",{"type":47,"value":147},"), the migration-package contract, the ",{"type":41,"tag":84,"props":149,"children":151},{"className":150},[],[152],{"type":47,"value":115},{"type":47,"value":154}," authoring API, and the failure modes you recover from without leaving the loop.",{"type":41,"tag":54,"props":156,"children":157},{},[158,163,165,170,171,176,178,184,186,192,194,200],{"type":41,"tag":58,"props":159,"children":160},{},[161],{"type":47,"value":162},"Targets.",{"type":47,"value":164}," Migration authoring is first-class for ",{"type":41,"tag":58,"props":166,"children":167},{},[168],{"type":47,"value":169},"Postgres",{"type":47,"value":131},{"type":41,"tag":58,"props":172,"children":173},{},[174],{"type":47,"value":175},"Mongo",{"type":47,"value":177},". The CLI reads the target from ",{"type":41,"tag":84,"props":179,"children":181},{"className":180},[],[182],{"type":47,"value":183},"prisma-next.config.ts",{"type":47,"value":185}," (set during ",{"type":41,"tag":84,"props":187,"children":189},{"className":188},[],[190],{"type":47,"value":191},"prisma-next init --target …",{"type":47,"value":193},"). Migration commands do not accept a ",{"type":41,"tag":84,"props":195,"children":197},{"className":196},[],[198],{"type":47,"value":199},"--target",{"type":47,"value":201}," flag — use a config scoped to the target you need. Examples below call out target-specific imports, markers, factories, and transaction behavior where they diverge.",{"type":41,"tag":203,"props":204,"children":206},"h2",{"id":205},"when-to-use",[207],{"type":47,"value":208},"When to Use",{"type":41,"tag":210,"props":211,"children":212},"ul",{},[213,218,223,228,249],{"type":41,"tag":73,"props":214,"children":215},{},[216],{"type":47,"value":217},"User edited the contract and wants to apply the change to the DB.",{"type":41,"tag":73,"props":219,"children":220},{},[221],{"type":47,"value":222},"User wants to author a migration with a data transform.",{"type":41,"tag":73,"props":224,"children":225},{},[226],{"type":47,"value":227},"User wants to run pending migrations against a local DB.",{"type":41,"tag":73,"props":229,"children":230},{},[231,233,239,241,247],{"type":47,"value":232},"User hit ",{"type":41,"tag":84,"props":234,"children":236},{"className":235},[],[237],{"type":47,"value":238},"MIGRATION.HASH_MISMATCH",{"type":47,"value":240},", ",{"type":41,"tag":84,"props":242,"children":244},{"className":243},[],[245],{"type":47,"value":246},"PN-MIG-2001",{"type":47,"value":248}," (unfilled placeholder), or a partially-applied migration.",{"type":41,"tag":73,"props":250,"children":251},{},[252,254,275],{"type":47,"value":253},"User mentions: ",{"type":41,"tag":255,"props":256,"children":257},"em",{},[258,260,266,267,273],{"type":47,"value":259},"migrate, migration, db push, db update, ",{"type":41,"tag":84,"props":261,"children":263},{"className":262},[],[264],{"type":47,"value":265},"prisma migrate dev",{"type":47,"value":240},{"type":41,"tag":84,"props":268,"children":270},{"className":269},[],[271],{"type":47,"value":272},"prisma migrate deploy",{"type":47,"value":274},", drift, hash mismatch, data backfill",{"type":47,"value":276},".",{"type":41,"tag":203,"props":278,"children":280},{"id":279},"when-not-to-use",[281],{"type":47,"value":282},"When Not to Use",{"type":41,"tag":210,"props":284,"children":285},{},[286,305,316],{"type":41,"tag":73,"props":287,"children":288},{},[289,291,296,298,304],{"type":47,"value":290},"User wants to know what migrations ",{"type":41,"tag":255,"props":292,"children":293},{},[294],{"type":47,"value":295},"will run on deploy",{"type":47,"value":297}," \u002F on merge, or to manage refs and invariants → ",{"type":41,"tag":84,"props":299,"children":301},{"className":300},[],[302],{"type":47,"value":303},"prisma-next-migration-review",{"type":47,"value":276},{"type":41,"tag":73,"props":306,"children":307},{},[308,310,315],{"type":47,"value":309},"User wants to edit the contract → ",{"type":41,"tag":84,"props":311,"children":313},{"className":312},[],[314],{"type":47,"value":89},{"type":47,"value":276},{"type":41,"tag":73,"props":317,"children":318},{},[319,321,327],{"type":47,"value":320},"User wants a deeper read of a single structured error envelope → ",{"type":41,"tag":84,"props":322,"children":324},{"className":323},[],[325],{"type":47,"value":326},"prisma-next-debug",{"type":47,"value":276},{"type":41,"tag":203,"props":329,"children":331},{"id":330},"key-concepts",[332],{"type":47,"value":333},"Key Concepts",{"type":41,"tag":210,"props":335,"children":336},{},[337,390,428,491,601,640,671,725,803,865,915,950,997,1086],{"type":41,"tag":73,"props":338,"children":339},{},[340,350,352,358,360,366,368,373,375,380,382,388],{"type":41,"tag":58,"props":341,"children":342},{},[343,348],{"type":41,"tag":84,"props":344,"children":346},{"className":345},[],[347],{"type":47,"value":129},{"type":47,"value":349}," (quick path).",{"type":47,"value":351}," Reads the emitted contract, diffs against the live DB, applies the change. Optional ",{"type":41,"tag":84,"props":353,"children":355},{"className":354},[],[356],{"type":47,"value":357},"--dry-run",{"type":47,"value":359}," prints the plan without executing. Interactive destructive-op confirmation (or ",{"type":41,"tag":84,"props":361,"children":363},{"className":362},[],[364],{"type":47,"value":365},"-y",{"type":47,"value":367}," to auto-accept). ",{"type":41,"tag":58,"props":369,"children":370},{},[371],{"type":47,"value":372},"Writes no migration directory.",{"type":47,"value":374}," Operations needing data transforms are not handled by this path — ",{"type":41,"tag":84,"props":376,"children":378},{"className":377},[],[379],{"type":47,"value":129},{"type":47,"value":381}," excludes the ",{"type":41,"tag":84,"props":383,"children":385},{"className":384},[],[386],{"type":47,"value":387},"data",{"type":47,"value":389}," operation class entirely and short-circuits where a data transform would be required. Use only against a database that has no shared history with anyone else (your local dev DB).",{"type":41,"tag":73,"props":391,"children":392},{},[393,403,405,411,413,418,420,426],{"type":41,"tag":58,"props":394,"children":395},{},[396,401],{"type":41,"tag":84,"props":397,"children":399},{"className":398},[],[400],{"type":47,"value":137},{"type":47,"value":402}," (formal path).",{"type":47,"value":404}," Reads the emitted contract, diffs against the head of the on-disk migration graph, writes a new migration package under ",{"type":41,"tag":84,"props":406,"children":408},{"className":407},[],[409],{"type":47,"value":410},"migrations\u002Fapp\u002F\u003CYYYYMMDDTHHMM>_\u003Csnake_slug>\u002F",{"type":47,"value":412},". If any operation needs a data transform, the package's ",{"type":41,"tag":84,"props":414,"children":416},{"className":415},[],[417],{"type":47,"value":115},{"type":47,"value":419}," contains ",{"type":41,"tag":84,"props":421,"children":423},{"className":422},[],[424],{"type":47,"value":425},"placeholder(...)",{"type":47,"value":427}," calls you fill in.",{"type":41,"tag":73,"props":429,"children":430},{},[431,444,446,451,453,459,461,467,469,474,476,481,483,489],{"type":41,"tag":58,"props":432,"children":433},{},[434,436,442],{"type":47,"value":435},"The ",{"type":41,"tag":84,"props":437,"children":439},{"className":438},[],[440],{"type":47,"value":441},"app\u002F",{"type":47,"value":443}," segment in migration paths is the consuming application's contract-space id.",{"type":47,"value":445}," Every migration ",{"type":41,"tag":255,"props":447,"children":448},{},[449],{"type":47,"value":450},"you",{"type":47,"value":452}," author lives under ",{"type":41,"tag":84,"props":454,"children":456},{"className":455},[],[457],{"type":47,"value":458},"migrations\u002Fapp\u002F",{"type":47,"value":460},". Extensions your contract depends on get their own sibling directories (",{"type":41,"tag":84,"props":462,"children":464},{"className":463},[],[465],{"type":47,"value":466},"migrations\u002F\u003Cextension-space-id>\u002F",{"type":47,"value":468},") — those are managed by the extension package and you don't write into them. The ",{"type":41,"tag":84,"props":470,"children":472},{"className":471},[],[473],{"type":47,"value":441},{"type":47,"value":475}," segment lands automatically the first time you run ",{"type":41,"tag":84,"props":477,"children":479},{"className":478},[],[480],{"type":47,"value":137},{"type":47,"value":482}," \u002F ",{"type":41,"tag":84,"props":484,"children":486},{"className":485},[],[487],{"type":47,"value":488},"db init",{"type":47,"value":490}," against an app-level config.",{"type":41,"tag":73,"props":492,"children":493},{},[494,499,501,507,509],{"type":41,"tag":58,"props":495,"children":496},{},[497],{"type":47,"value":498},"Migration package files",{"type":47,"value":500}," (inside each ",{"type":41,"tag":84,"props":502,"children":504},{"className":503},[],[505],{"type":47,"value":506},"migrations\u002Fapp\u002F\u003Cdir>\u002F",{"type":47,"value":508},"):\n",{"type":41,"tag":210,"props":510,"children":511},{},[512,531,549],{"type":41,"tag":73,"props":513,"children":514},{},[515,521,523,529],{"type":41,"tag":84,"props":516,"children":518},{"className":517},[],[519],{"type":47,"value":520},"migration.json",{"type":47,"value":522}," — manifest (metadata + ",{"type":41,"tag":84,"props":524,"children":526},{"className":525},[],[527],{"type":47,"value":528},"migrationHash",{"type":47,"value":530},").",{"type":41,"tag":73,"props":532,"children":533},{},[534,540,542,547],{"type":41,"tag":84,"props":535,"children":537},{"className":536},[],[538],{"type":47,"value":539},"ops.json",{"type":47,"value":541}," — canonical operation list. Content-addressed; ",{"type":41,"tag":84,"props":543,"children":545},{"className":544},[],[546],{"type":47,"value":528},{"type":47,"value":548}," is computed over this.",{"type":41,"tag":73,"props":550,"children":551},{},[552,557,559,564,566,571,573,579,581,586,588,593,594,599],{"type":41,"tag":84,"props":553,"children":555},{"className":554},[],[556],{"type":47,"value":115},{"type":47,"value":558}," — TypeScript authoring source, ",{"type":41,"tag":58,"props":560,"children":561},{},[562],{"type":47,"value":563},"framework-rendered",{"type":47,"value":565}," by ",{"type":41,"tag":84,"props":567,"children":569},{"className":568},[],[570],{"type":47,"value":137},{"type":47,"value":572}," (or ",{"type":41,"tag":84,"props":574,"children":576},{"className":575},[],[577],{"type":47,"value":578},"migration new",{"type":47,"value":580},"). You edit specific holes in it (see ",{"type":41,"tag":255,"props":582,"children":583},{},[584],{"type":47,"value":585},"Fill a placeholder",{"type":47,"value":587}," below) and re-emit ",{"type":41,"tag":84,"props":589,"children":591},{"className":590},[],[592],{"type":47,"value":539},{"type":47,"value":482},{"type":41,"tag":84,"props":595,"children":597},{"className":596},[],[598],{"type":47,"value":520},{"type":47,"value":600}," by running it.",{"type":41,"tag":73,"props":602,"children":603},{},[604,609,611,616,618,624,625,631,632,638],{"type":41,"tag":58,"props":605,"children":606},{},[607],{"type":47,"value":608},"Contract snapshots.",{"type":47,"value":610}," ",{"type":41,"tag":84,"props":612,"children":614},{"className":613},[],[615],{"type":47,"value":115},{"type":47,"value":617}," imports its bookend contracts from the shared, content-addressed store at ",{"type":41,"tag":84,"props":619,"children":621},{"className":620},[],[622],{"type":47,"value":623},"migrations\u002Fsnapshots\u002F\u003Chex>\u002Fcontract.json",{"type":47,"value":139},{"type":41,"tag":84,"props":626,"children":628},{"className":627},[],[629],{"type":47,"value":630},"contract.d.ts",{"type":47,"value":82},{"type":41,"tag":84,"props":633,"children":635},{"className":634},[],[636],{"type":47,"value":637},"\u003Chex>",{"type":47,"value":639}," is the contract's 64-hex storage hash) — not from files inside the migration package.",{"type":41,"tag":73,"props":641,"children":642},{},[643,648,650,656,658,663,664,669],{"type":41,"tag":58,"props":644,"children":645},{},[646],{"type":47,"value":647},"Self-emit.",{"type":47,"value":649}," Running ",{"type":41,"tag":84,"props":651,"children":653},{"className":652},[],[654],{"type":47,"value":655},"node migrations\u002Fapp\u002F\u003Cdir>\u002Fmigration.ts",{"type":47,"value":657}," regenerates ",{"type":41,"tag":84,"props":659,"children":661},{"className":660},[],[662],{"type":47,"value":539},{"type":47,"value":131},{"type":41,"tag":84,"props":665,"children":667},{"className":666},[],[668],{"type":47,"value":520},{"type":47,"value":670}," from the (possibly edited) TS source. This is the only supported way to update an existing migration package after edits.",{"type":41,"tag":73,"props":672,"children":673},{},[674,684,686,691,693,699,701,707,709,715,717,723],{"type":41,"tag":58,"props":675,"children":676},{},[677,682],{"type":41,"tag":84,"props":678,"children":680},{"className":679},[],[681],{"type":47,"value":115},{"type":47,"value":683}," shape.",{"type":47,"value":685}," Framework-rendered. A class extending ",{"type":41,"tag":84,"props":687,"children":689},{"className":688},[],[690],{"type":47,"value":20},{"type":47,"value":692}," (from ",{"type":41,"tag":84,"props":694,"children":696},{"className":695},[],[697],{"type":47,"value":698},"@prisma-next\u002Ffamily-mongo\u002Fmigration",{"type":47,"value":700}," on Mongo, or re-exported via ",{"type":41,"tag":84,"props":702,"children":704},{"className":703},[],[705],{"type":47,"value":706},"@prisma-next\u002Fpostgres\u002Fmigration",{"type":47,"value":708}," on Postgres — see the framing block below), with an ",{"type":41,"tag":84,"props":710,"children":712},{"className":711},[],[713],{"type":47,"value":714},"operations",{"type":47,"value":716}," getter that returns an array of factory-call values. The file ends with ",{"type":41,"tag":84,"props":718,"children":720},{"className":719},[],[721],{"type":47,"value":722},"MigrationCLI.run(import.meta.url, M)",{"type":47,"value":724}," so executing it self-emits.",{"type":41,"tag":73,"props":726,"children":727},{},[728,738,740,745,746,752,754,759,761,766,768,773,774,779,781,787,789,795,797,801],{"type":41,"tag":58,"props":729,"children":730},{},[731,737],{"type":41,"tag":84,"props":732,"children":734},{"className":733},[],[735],{"type":47,"value":736},"placeholder(slot)",{"type":47,"value":276},{"type":47,"value":739}," A sentinel the planner emits into the rendered ",{"type":41,"tag":84,"props":741,"children":743},{"className":742},[],[744],{"type":47,"value":115},{"type":47,"value":692},{"type":41,"tag":84,"props":747,"children":749},{"className":748},[],[750],{"type":47,"value":751},"@prisma-next\u002Ferrors\u002Fmigration",{"type":47,"value":753}," on Mongo, or the ",{"type":41,"tag":84,"props":755,"children":757},{"className":756},[],[758],{"type":47,"value":706},{"type":47,"value":760}," import on Postgres) wherever a data transform is needed. Calling ",{"type":41,"tag":84,"props":762,"children":764},{"className":763},[],[765],{"type":47,"value":425},{"type":47,"value":767}," at emit time throws ",{"type":41,"tag":84,"props":769,"children":771},{"className":770},[],[772],{"type":47,"value":246},{"type":47,"value":610},{"type":41,"tag":255,"props":775,"children":776},{},[777],{"type":47,"value":778},"Unfilled migration placeholder",{"type":47,"value":780},". The user replaces the ",{"type":41,"tag":84,"props":782,"children":784},{"className":783},[],[785],{"type":47,"value":786},"() => placeholder(...)",{"type":47,"value":788}," arrow with a real query-plan closure (Postgres) or fills ",{"type":41,"tag":84,"props":790,"children":792},{"className":791},[],[793],{"type":47,"value":794},"dataTransform({ check, run })",{"type":47,"value":796}," sources (Mongo — see ",{"type":41,"tag":255,"props":798,"children":799},{},[800],{"type":47,"value":585},{"type":47,"value":802},"), then self-emits.",{"type":41,"tag":73,"props":804,"children":805},{},[806,816,818,824,826,832,834,840,842,847,849,855,857,863],{"type":41,"tag":58,"props":807,"children":808},{},[809,815],{"type":41,"tag":84,"props":810,"children":812},{"className":811},[],[813],{"type":47,"value":814},"this.dataTransform(endContract, name, { check, run })",{"type":47,"value":276},{"type":47,"value":817}," The data-transform factory. ",{"type":41,"tag":84,"props":819,"children":821},{"className":820},[],[822],{"type":47,"value":823},"check",{"type":47,"value":825}," is a rowset query whose presence-of-any-row signals \"work remains\"; ",{"type":41,"tag":84,"props":827,"children":829},{"className":828},[],[830],{"type":47,"value":831},"run",{"type":47,"value":833}," is one or more mutation queries that perform the backfill. Both are lazy closures returning query-plans built against ",{"type":41,"tag":84,"props":835,"children":837},{"className":836},[],[838],{"type":47,"value":839},"endContract",{"type":47,"value":841},". The runner wraps ",{"type":41,"tag":84,"props":843,"children":845},{"className":844},[],[846],{"type":47,"value":823},{"type":47,"value":848}," as ",{"type":41,"tag":84,"props":850,"children":852},{"className":851},[],[853],{"type":47,"value":854},"EXISTS(...)",{"type":47,"value":856}," for precheck and ",{"type":41,"tag":84,"props":858,"children":860},{"className":859},[],[861],{"type":47,"value":862},"NOT EXISTS(...)",{"type":47,"value":864}," for postcheck, so the same closure asserts both \"there is work\" and \"the work is done\".",{"type":41,"tag":73,"props":866,"children":867},{},[868,878,880,885,887,893,895,900,902,907,909,914],{"type":41,"tag":58,"props":869,"children":870},{},[871,877],{"type":41,"tag":84,"props":872,"children":874},{"className":873},[],[875],{"type":47,"value":876},"pendingPlaceholders",{"type":47,"value":276},{"type":47,"value":879}," A boolean field on the JSON result of ",{"type":41,"tag":84,"props":881,"children":883},{"className":882},[],[884],{"type":47,"value":137},{"type":47,"value":886},". ",{"type":41,"tag":84,"props":888,"children":890},{"className":889},[],[891],{"type":47,"value":892},"true",{"type":47,"value":894}," means the package was written but contains unfilled placeholders — ",{"type":41,"tag":84,"props":896,"children":898},{"className":897},[],[899],{"type":47,"value":145},{"type":47,"value":901}," will throw ",{"type":41,"tag":84,"props":903,"children":905},{"className":904},[],[906],{"type":47,"value":246},{"type":47,"value":908}," until you edit ",{"type":41,"tag":84,"props":910,"children":912},{"className":911},[],[913],{"type":47,"value":115},{"type":47,"value":117},{"type":41,"tag":73,"props":916,"children":917},{},[918,927,929,934,936,941,943,948],{"type":41,"tag":58,"props":919,"children":920},{},[921,926],{"type":41,"tag":84,"props":922,"children":924},{"className":923},[],[925],{"type":47,"value":528},{"type":47,"value":276},{"type":47,"value":928}," Content-addressed identity of a migration package. ",{"type":41,"tag":84,"props":930,"children":932},{"className":931},[],[933],{"type":47,"value":238},{"type":47,"value":935}," fires when the stored hash in ",{"type":41,"tag":84,"props":937,"children":939},{"className":938},[],[940],{"type":47,"value":520},{"type":47,"value":942}," disagrees with the hash recomputed from the on-disk files (almost always: someone edited ",{"type":41,"tag":84,"props":944,"children":946},{"className":945},[],[947],{"type":47,"value":115},{"type":47,"value":949}," without self-emitting).",{"type":41,"tag":73,"props":951,"children":952},{},[953,958,960,965,967,973,974,979,981,987,989,995],{"type":41,"tag":58,"props":954,"children":955},{},[956],{"type":47,"value":957},"Marker.",{"type":47,"value":959}," Records \"this database is at contract hash X for space Y\". ",{"type":41,"tag":58,"props":961,"children":962},{},[963],{"type":47,"value":964},"Postgres:",{"type":47,"value":966}," a row in ",{"type":41,"tag":84,"props":968,"children":970},{"className":969},[],[971],{"type":47,"value":972},"prisma_contract.marker",{"type":47,"value":886},{"type":41,"tag":58,"props":975,"children":976},{},[977],{"type":47,"value":978},"Mongo:",{"type":47,"value":980}," a document in the ",{"type":41,"tag":84,"props":982,"children":984},{"className":983},[],[985],{"type":47,"value":986},"_prisma_migrations",{"type":47,"value":988}," collection (keyed by space). Each successful migration advances the marker once schema verification passes for that space. ",{"type":41,"tag":84,"props":990,"children":992},{"className":991},[],[993],{"type":47,"value":994},"db sign",{"type":47,"value":996}," writes the marker from the current contract hash, but only after a schema-verification pass succeeds (it will not sign a database whose live schema disagrees with the contract).",{"type":41,"tag":73,"props":998,"children":999},{},[1000,1005,1006,1010,1012,1018,1020,1026,1028,1032,1034,1040,1041,1047,1048,1054,1055,1061,1063,1069,1071,1077,1078,1084],{"type":41,"tag":58,"props":1001,"children":1002},{},[1003],{"type":47,"value":1004},"Apply atomicity.",{"type":47,"value":610},{"type":41,"tag":58,"props":1007,"children":1008},{},[1009],{"type":47,"value":964},{"type":47,"value":1011}," each migration runs inside ",{"type":41,"tag":84,"props":1013,"children":1015},{"className":1014},[],[1016],{"type":47,"value":1017},"BEGIN ... COMMIT",{"type":47,"value":1019},"; on failure, Postgres rolls back and the marker stays at the previous migration's ",{"type":41,"tag":84,"props":1021,"children":1023},{"className":1022},[],[1024],{"type":47,"value":1025},"to",{"type":47,"value":1027}," hash. ",{"type":41,"tag":58,"props":1029,"children":1030},{},[1031],{"type":47,"value":978},{"type":47,"value":1033}," DDL ops (",{"type":41,"tag":84,"props":1035,"children":1037},{"className":1036},[],[1038],{"type":47,"value":1039},"createCollection",{"type":47,"value":240},{"type":41,"tag":84,"props":1042,"children":1044},{"className":1043},[],[1045],{"type":47,"value":1046},"createIndex",{"type":47,"value":240},{"type":41,"tag":84,"props":1049,"children":1051},{"className":1050},[],[1052],{"type":47,"value":1053},"collMod",{"type":47,"value":240},{"type":41,"tag":84,"props":1056,"children":1058},{"className":1057},[],[1059],{"type":47,"value":1060},"setValidation",{"type":47,"value":1062},", …) are not wrapped in a multi-document transaction; the runner applies ops, verifies the live schema against the destination contract, and advances the marker only on verify-pass (resumable across spaces — see the MongoDB family doc). Ordinary DDL + ",{"type":41,"tag":84,"props":1064,"children":1066},{"className":1065},[],[1067],{"type":47,"value":1068},"dataTransform",{"type":47,"value":1070}," flows stay consistent; partial state from failed mid-migration runs is diagnosed with ",{"type":41,"tag":84,"props":1072,"children":1074},{"className":1073},[],[1075],{"type":47,"value":1076},"db verify",{"type":47,"value":482},{"type":41,"tag":84,"props":1079,"children":1081},{"className":1080},[],[1082],{"type":47,"value":1083},"db schema",{"type":47,"value":1085},", not assumed away.",{"type":41,"tag":73,"props":1087,"children":1088},{},[1089,1094,1096,1102,1104,1110,1111,1117,1118,1123,1125,1131,1133,1139,1141,1147],{"type":41,"tag":58,"props":1090,"children":1091},{},[1092],{"type":47,"value":1093},"Operation classes.",{"type":47,"value":1095}," Every operation declares an ",{"type":41,"tag":84,"props":1097,"children":1099},{"className":1098},[],[1100],{"type":47,"value":1101},"operationClass",{"type":47,"value":1103},": ",{"type":41,"tag":84,"props":1105,"children":1107},{"className":1106},[],[1108],{"type":47,"value":1109},"additive",{"type":47,"value":240},{"type":41,"tag":84,"props":1112,"children":1114},{"className":1113},[],[1115],{"type":47,"value":1116},"widening",{"type":47,"value":240},{"type":41,"tag":84,"props":1119,"children":1121},{"className":1120},[],[1122],{"type":47,"value":387},{"type":47,"value":1124},", or ",{"type":41,"tag":84,"props":1126,"children":1128},{"className":1127},[],[1129],{"type":47,"value":1130},"destructive",{"type":47,"value":1132},". The CLI surfaces these in the plan preview and in JSON output. There is no ",{"type":41,"tag":84,"props":1134,"children":1136},{"className":1135},[],[1137],{"type":47,"value":1138},"long-running",{"type":47,"value":1140}," class and the framework does not emit ",{"type":41,"tag":84,"props":1142,"children":1144},{"className":1143},[],[1145],{"type":47,"value":1146},"CREATE INDEX CONCURRENTLY",{"type":47,"value":1148}," — operations stay transactional.",{"type":41,"tag":203,"props":1150,"children":1152},{"id":1151},"migrationts-is-framework-rendered-not-hand-authored",[1153,1158],{"type":41,"tag":84,"props":1154,"children":1156},{"className":1155},[],[1157],{"type":47,"value":115},{"type":47,"value":1159}," is framework-rendered, not hand-authored",{"type":41,"tag":54,"props":1161,"children":1162},{},[1163,1165,1171,1173,1179,1181,1186,1188,1193,1195,1201,1203,1209,1211,1217,1219,1224],{"type":47,"value":1164},"Files under ",{"type":41,"tag":84,"props":1166,"children":1168},{"className":1167},[],[1169],{"type":47,"value":1170},"migrations\u002F\u003Cspace-id>\u002F\u003Ctimestamp>\u002Fmigration.ts",{"type":47,"value":1172}," (for your own app, ",{"type":41,"tag":84,"props":1174,"children":1176},{"className":1175},[],[1177],{"type":47,"value":1178},"\u003Cspace-id>",{"type":47,"value":1180}," is always ",{"type":41,"tag":84,"props":1182,"children":1184},{"className":1183},[],[1185],{"type":47,"value":441},{"type":47,"value":1187},") are ",{"type":41,"tag":58,"props":1189,"children":1190},{},[1191],{"type":47,"value":1192},"rendered for you",{"type":47,"value":1194}," by the framework — ",{"type":41,"tag":84,"props":1196,"children":1198},{"className":1197},[],[1199],{"type":47,"value":1200},"prisma-next migration plan",{"type":47,"value":1202}," writes a populated package whenever the contract changes, and ",{"type":41,"tag":84,"props":1204,"children":1206},{"className":1205},[],[1207],{"type":47,"value":1208},"prisma-next migration new",{"type":47,"value":1210}," writes an empty scaffold when you want to author operations directly. You do not write these files from scratch. You edit specific holes the framework leaves behind — chiefly replacing ",{"type":41,"tag":84,"props":1212,"children":1214},{"className":1213},[],[1215],{"type":47,"value":1216},"placeholder(\"\u003Cslot>\")",{"type":47,"value":1218}," sentinels (Postgres) or filling ",{"type":41,"tag":84,"props":1220,"children":1222},{"className":1221},[],[1223],{"type":47,"value":794},{"type":47,"value":1225}," pipeline slots (Mongo) — then self-emit.",{"type":41,"tag":54,"props":1227,"children":1228},{},[1229,1233,1235,1240,1241,1247],{"type":41,"tag":58,"props":1230,"children":1231},{},[1232],{"type":47,"value":169},{"type":47,"value":1234}," rendered imports point at ",{"type":41,"tag":84,"props":1236,"children":1238},{"className":1237},[],[1239],{"type":47,"value":706},{"type":47,"value":572},{"type":41,"tag":84,"props":1242,"children":1244},{"className":1243},[],[1245],{"type":47,"value":1246},"@prisma-next\u002Fsqlite\u002Fmigration",{"type":47,"value":1248}," for SQLite projects).",{"type":41,"tag":54,"props":1250,"children":1251},{},[1252,1256,1258,1263,1265,1270,1272,1278,1280,1285,1286,1291,1293,1299,1301,1307],{"type":41,"tag":58,"props":1253,"children":1254},{},[1255],{"type":47,"value":175},{"type":47,"value":1257}," rendered imports use ",{"type":41,"tag":84,"props":1259,"children":1261},{"className":1260},[],[1262],{"type":47,"value":698},{"type":47,"value":1264}," for the ",{"type":41,"tag":84,"props":1266,"children":1268},{"className":1267},[],[1269],{"type":47,"value":20},{"type":47,"value":1271}," base class and ",{"type":41,"tag":84,"props":1273,"children":1275},{"className":1274},[],[1276],{"type":47,"value":1277},"@prisma-next\u002Ftarget-mongo\u002Fmigration",{"type":47,"value":1279}," for operation factories (",{"type":41,"tag":84,"props":1281,"children":1283},{"className":1282},[],[1284],{"type":47,"value":1046},{"type":47,"value":240},{"type":41,"tag":84,"props":1287,"children":1289},{"className":1288},[],[1290],{"type":47,"value":1068},{"type":47,"value":1292},", …). ",{"type":41,"tag":84,"props":1294,"children":1296},{"className":1295},[],[1297],{"type":47,"value":1298},"MigrationCLI",{"type":47,"value":1300}," comes from ",{"type":41,"tag":84,"props":1302,"children":1304},{"className":1303},[],[1305],{"type":47,"value":1306},"@prisma-next\u002Fcli\u002Fmigration-cli",{"type":47,"value":276},{"type":41,"tag":54,"props":1309,"children":1310},{},[1311],{"type":47,"value":1312},"Treat the rendered import lines as framework-managed on both targets:",{"type":41,"tag":210,"props":1314,"children":1315},{},[1316,1336,1370],{"type":41,"tag":73,"props":1317,"children":1318},{},[1319,1321,1327,1329,1334],{"type":47,"value":1320},"Leave them where they are. Don't rewrite them to a different ",{"type":41,"tag":84,"props":1322,"children":1324},{"className":1323},[],[1325],{"type":47,"value":1326},"@prisma-next\u002F\u003C…>",{"type":47,"value":1328}," path; the framework's renderer is the authoritative shape and any change you make by hand will be reverted (and may trip ",{"type":41,"tag":84,"props":1330,"children":1332},{"className":1331},[],[1333],{"type":47,"value":238},{"type":47,"value":1335},") the next time the package is re-rendered or self-emitted.",{"type":41,"tag":73,"props":1337,"children":1338},{},[1339,1341,1346,1348,1353,1355,1360,1362,1368],{"type":47,"value":1340},"If you need an additional factory symbol, ",{"type":41,"tag":58,"props":1342,"children":1343},{},[1344],{"type":47,"value":1345},"add it to the existing rendered import line",{"type":47,"value":1347}," (Postgres: ",{"type":41,"tag":84,"props":1349,"children":1351},{"className":1350},[],[1352],{"type":47,"value":706},{"type":47,"value":1354},"; Mongo: ",{"type":41,"tag":84,"props":1356,"children":1358},{"className":1357},[],[1359],{"type":47,"value":1277},{"type":47,"value":1361},") rather than introducing a second import from a different ",{"type":41,"tag":84,"props":1363,"children":1365},{"className":1364},[],[1366],{"type":47,"value":1367},"@prisma-next\u002F...",{"type":47,"value":1369}," subpath.",{"type":41,"tag":73,"props":1371,"children":1372},{},[1373,1375,1381,1383,1388,1390,1395],{"type":47,"value":1374},"The \"user code imports only from ",{"type":41,"tag":84,"props":1376,"children":1378},{"className":1377},[],[1379],{"type":47,"value":1380},"@prisma-next\u002F\u003Ctarget>",{"type":47,"value":1382},"\" convention applies to ",{"type":41,"tag":255,"props":1384,"children":1385},{},[1386],{"type":47,"value":1387},"your",{"type":47,"value":1389}," own modules (queries, runtime setup, contract authoring). The framework-rendered ",{"type":41,"tag":84,"props":1391,"children":1393},{"className":1392},[],[1394],{"type":47,"value":115},{"type":47,"value":1396}," scaffold is the framework's surface, not yours; the rule is suspended for that one file.",{"type":41,"tag":203,"props":1398,"children":1400},{"id":1399},"diagnostic-codes-you-route-on",[1401],{"type":47,"value":1402},"Diagnostic codes you route on",{"type":41,"tag":1404,"props":1405,"children":1406},"table",{},[1407,1431],{"type":41,"tag":1408,"props":1409,"children":1410},"thead",{},[1411],{"type":41,"tag":1412,"props":1413,"children":1414},"tr",{},[1415,1421,1426],{"type":41,"tag":1416,"props":1417,"children":1418},"th",{},[1419],{"type":47,"value":1420},"Code",{"type":41,"tag":1416,"props":1422,"children":1423},{},[1424],{"type":47,"value":1425},"Source",{"type":41,"tag":1416,"props":1427,"children":1428},{},[1429],{"type":47,"value":1430},"Move",{"type":41,"tag":1432,"props":1433,"children":1434},"tbody",{},[1435,1483,1518,1565,1615,1671,1732],{"type":41,"tag":1412,"props":1436,"children":1437},{},[1438,1452,1464],{"type":41,"tag":1439,"props":1440,"children":1441},"td",{},[1442,1447,1448],{"type":41,"tag":84,"props":1443,"children":1445},{"className":1444},[],[1446],{"type":47,"value":246},{"type":47,"value":610},{"type":41,"tag":255,"props":1449,"children":1450},{},[1451],{"type":47,"value":778},{"type":41,"tag":1439,"props":1453,"children":1454},{},[1455,1457,1462],{"type":47,"value":1456},"Throwing ",{"type":41,"tag":84,"props":1458,"children":1460},{"className":1459},[],[1461],{"type":47,"value":425},{"type":47,"value":1463}," at emit time",{"type":41,"tag":1439,"props":1465,"children":1466},{},[1467,1469,1474,1476,1481],{"type":47,"value":1468},"Open ",{"type":41,"tag":84,"props":1470,"children":1472},{"className":1471},[],[1473],{"type":47,"value":115},{"type":47,"value":1475},", replace the named ",{"type":41,"tag":84,"props":1477,"children":1479},{"className":1478},[],[1480],{"type":47,"value":1216},{"type":47,"value":1482}," call with the real query closure, self-emit.",{"type":41,"tag":1412,"props":1484,"children":1485},{},[1486,1501,1506],{"type":41,"tag":1439,"props":1487,"children":1488},{},[1489,1495,1496],{"type":41,"tag":84,"props":1490,"children":1492},{"className":1491},[],[1493],{"type":47,"value":1494},"PN-MIG-2002",{"type":47,"value":610},{"type":41,"tag":255,"props":1497,"children":1498},{},[1499],{"type":47,"value":1500},"migration.ts not found",{"type":41,"tag":1439,"props":1502,"children":1503},{},[1504],{"type":47,"value":1505},"Reading a migration package",{"type":41,"tag":1439,"props":1507,"children":1508},{},[1509,1511,1516],{"type":47,"value":1510},"The package is malformed. Recover from version control, or run ",{"type":41,"tag":84,"props":1512,"children":1514},{"className":1513},[],[1515],{"type":47,"value":1208},{"type":47,"value":1517}," for a fresh one.",{"type":41,"tag":1412,"props":1519,"children":1520},{},[1521,1536,1546],{"type":41,"tag":1439,"props":1522,"children":1523},{},[1524,1530,1531],{"type":41,"tag":84,"props":1525,"children":1527},{"className":1526},[],[1528],{"type":47,"value":1529},"PN-MIG-2003",{"type":47,"value":610},{"type":41,"tag":255,"props":1532,"children":1533},{},[1534],{"type":47,"value":1535},"invalid default export",{"type":41,"tag":1439,"props":1537,"children":1538},{},[1539,1541],{"type":47,"value":1540},"Loading ",{"type":41,"tag":84,"props":1542,"children":1544},{"className":1543},[],[1545],{"type":47,"value":115},{"type":41,"tag":1439,"props":1547,"children":1548},{},[1549,1551,1556,1558,1563],{"type":47,"value":1550},"The file's default export is not a ",{"type":41,"tag":84,"props":1552,"children":1554},{"className":1553},[],[1555],{"type":47,"value":20},{"type":47,"value":1557}," subclass or factory function. Restore the planner-emitted scaffold from version control or re-run ",{"type":41,"tag":84,"props":1559,"children":1561},{"className":1560},[],[1562],{"type":47,"value":137},{"type":47,"value":1564}," for a clean package.",{"type":41,"tag":1412,"props":1566,"children":1567},{},[1568,1583,1588],{"type":41,"tag":1439,"props":1569,"children":1570},{},[1571,1577,1578],{"type":41,"tag":84,"props":1572,"children":1574},{"className":1573},[],[1575],{"type":47,"value":1576},"PN-MIG-2005",{"type":47,"value":610},{"type":41,"tag":255,"props":1579,"children":1580},{},[1581],{"type":47,"value":1582},"dataTransform contract mismatch",{"type":41,"tag":1439,"props":1584,"children":1585},{},[1586],{"type":47,"value":1587},"Building a data-transform query plan",{"type":41,"tag":1439,"props":1589,"children":1590},{},[1591,1593,1598,1600,1606,1608,1613],{"type":47,"value":1592},"The query builder was instantiated with a contract reference different from the ",{"type":41,"tag":84,"props":1594,"children":1596},{"className":1595},[],[1597],{"type":47,"value":839},{"type":47,"value":1599}," passed to ",{"type":41,"tag":84,"props":1601,"children":1603},{"className":1602},[],[1604],{"type":47,"value":1605},"this.dataTransform(...)",{"type":47,"value":1607},". Use the ",{"type":41,"tag":84,"props":1609,"children":1611},{"className":1610},[],[1612],{"type":47,"value":839},{"type":47,"value":1614}," imported at module scope for both.",{"type":41,"tag":1412,"props":1616,"children":1617},{},[1618,1632,1642],{"type":41,"tag":1439,"props":1619,"children":1620},{},[1621,1626,1627],{"type":41,"tag":84,"props":1622,"children":1624},{"className":1623},[],[1625],{"type":47,"value":238},{"type":47,"value":610},{"type":41,"tag":255,"props":1628,"children":1629},{},[1630],{"type":47,"value":1631},"Migration package is corrupt",{"type":41,"tag":1439,"props":1633,"children":1634},{},[1635,1640],{"type":41,"tag":84,"props":1636,"children":1638},{"className":1637},[],[1639],{"type":47,"value":145},{"type":47,"value":1641}," (or any read of the package)",{"type":41,"tag":1439,"props":1643,"children":1644},{},[1645,1650,1651,1656,1658,1663,1665,1670],{"type":41,"tag":84,"props":1646,"children":1648},{"className":1647},[],[1649],{"type":47,"value":539},{"type":47,"value":482},{"type":41,"tag":84,"props":1652,"children":1654},{"className":1653},[],[1655],{"type":47,"value":520},{"type":47,"value":1657}," were edited without self-emitting. Run ",{"type":41,"tag":84,"props":1659,"children":1661},{"className":1660},[],[1662],{"type":47,"value":655},{"type":47,"value":1664}," to re-emit, then re-run ",{"type":41,"tag":84,"props":1666,"children":1668},{"className":1667},[],[1669],{"type":47,"value":145},{"type":47,"value":276},{"type":41,"tag":1412,"props":1672,"children":1673},{},[1674,1689,1697],{"type":41,"tag":1439,"props":1675,"children":1676},{},[1677,1683,1684],{"type":41,"tag":84,"props":1678,"children":1680},{"className":1679},[],[1681],{"type":47,"value":1682},"PN-RUN-3002",{"type":47,"value":610},{"type":41,"tag":255,"props":1685,"children":1686},{},[1687],{"type":47,"value":1688},"Hash mismatch",{"type":41,"tag":1439,"props":1690,"children":1691},{},[1692],{"type":41,"tag":84,"props":1693,"children":1695},{"className":1694},[],[1696],{"type":47,"value":1076},{"type":41,"tag":1439,"props":1698,"children":1699},{},[1700,1702,1706,1707,1712,1714,1718,1719,1724,1726,1731],{"type":47,"value":1701},"The marker disagrees with the contract hash (",{"type":41,"tag":58,"props":1703,"children":1704},{},[1705],{"type":47,"value":964},{"type":47,"value":610},{"type":41,"tag":84,"props":1708,"children":1710},{"className":1709},[],[1711],{"type":47,"value":972},{"type":47,"value":1713},"; ",{"type":41,"tag":58,"props":1715,"children":1716},{},[1717],{"type":47,"value":978},{"type":47,"value":610},{"type":41,"tag":84,"props":1720,"children":1722},{"className":1721},[],[1723],{"type":47,"value":986},{"type":47,"value":1725},"). The DB is at a different contract version than the code thinks. Either run a migration forward, or — if the DB is correct and the marker is stale after a manual fix-up — run ",{"type":41,"tag":84,"props":1727,"children":1729},{"className":1728},[],[1730],{"type":47,"value":994},{"type":47,"value":276},{"type":41,"tag":1412,"props":1733,"children":1734},{},[1735,1750,1755],{"type":41,"tag":1439,"props":1736,"children":1737},{},[1738,1744,1745],{"type":41,"tag":84,"props":1739,"children":1741},{"className":1740},[],[1742],{"type":47,"value":1743},"PN-RUN-3001",{"type":47,"value":610},{"type":41,"tag":255,"props":1746,"children":1747},{},[1748],{"type":47,"value":1749},"Database not signed",{"type":41,"tag":1439,"props":1751,"children":1752},{},[1753],{"type":47,"value":1754},"Any command needing a marker",{"type":41,"tag":1439,"props":1756,"children":1757},{},[1758,1760,1766,1768,1774],{"type":47,"value":1759},"The DB has no marker yet. Run ",{"type":41,"tag":84,"props":1761,"children":1763},{"className":1762},[],[1764],{"type":47,"value":1765},"prisma-next db init --db \u003Curl>",{"type":47,"value":1767}," to baseline an empty database, or ",{"type":41,"tag":84,"props":1769,"children":1771},{"className":1770},[],[1772],{"type":47,"value":1773},"db update --db \u003Curl>",{"type":47,"value":1775}," to apply the current contract directly.",{"type":41,"tag":203,"props":1777,"children":1779},{"id":1778},"decision-which-path-do-you-take",[1780],{"type":47,"value":1781},"Decision — which path do you take?",{"type":41,"tag":1404,"props":1783,"children":1784},{},[1785,1806],{"type":41,"tag":1408,"props":1786,"children":1787},{},[1788],{"type":41,"tag":1412,"props":1789,"children":1790},{},[1791,1796,1801],{"type":41,"tag":1416,"props":1792,"children":1793},{},[1794],{"type":47,"value":1795},"Situation",{"type":41,"tag":1416,"props":1797,"children":1798},{},[1799],{"type":47,"value":1800},"Path",{"type":41,"tag":1416,"props":1802,"children":1803},{},[1804],{"type":47,"value":1805},"Why",{"type":41,"tag":1432,"props":1807,"children":1808},{},[1809,1830,1857,1884,1932],{"type":41,"tag":1412,"props":1810,"children":1811},{},[1812,1817,1825],{"type":41,"tag":1439,"props":1813,"children":1814},{},[1815],{"type":47,"value":1816},"Local dev, schema in flux",{"type":41,"tag":1439,"props":1818,"children":1819},{},[1820],{"type":41,"tag":84,"props":1821,"children":1823},{"className":1822},[],[1824],{"type":47,"value":129},{"type":41,"tag":1439,"props":1826,"children":1827},{},[1828],{"type":47,"value":1829},"Fast, interactive, no migration files.",{"type":41,"tag":1412,"props":1831,"children":1832},{},[1833,1838,1852],{"type":41,"tag":1439,"props":1834,"children":1835},{},[1836],{"type":47,"value":1837},"Shared branch with other developers",{"type":41,"tag":1439,"props":1839,"children":1840},{},[1841,1846,1847],{"type":41,"tag":84,"props":1842,"children":1844},{"className":1843},[],[1845],{"type":47,"value":137},{"type":47,"value":139},{"type":41,"tag":84,"props":1848,"children":1850},{"className":1849},[],[1851],{"type":47,"value":145},{"type":41,"tag":1439,"props":1853,"children":1854},{},[1855],{"type":47,"value":1856},"Replayable, reviewable, content-hashed.",{"type":41,"tag":1412,"props":1858,"children":1859},{},[1860,1865,1879],{"type":41,"tag":1439,"props":1861,"children":1862},{},[1863],{"type":47,"value":1864},"Anything reaching production",{"type":41,"tag":1439,"props":1866,"children":1867},{},[1868,1873,1874],{"type":41,"tag":84,"props":1869,"children":1871},{"className":1870},[],[1872],{"type":47,"value":137},{"type":47,"value":139},{"type":41,"tag":84,"props":1875,"children":1877},{"className":1876},[],[1878],{"type":47,"value":145},{"type":41,"tag":1439,"props":1880,"children":1881},{},[1882],{"type":47,"value":1883},"Production must run a reviewed, hashed migration.",{"type":41,"tag":1412,"props":1885,"children":1886},{},[1887,1892,1922],{"type":41,"tag":1439,"props":1888,"children":1889},{},[1890],{"type":47,"value":1891},"Adding a column that needs a backfill",{"type":41,"tag":1439,"props":1893,"children":1894},{},[1895,1900,1902,1908,1910,1915,1917],{"type":41,"tag":84,"props":1896,"children":1898},{"className":1897},[],[1899],{"type":47,"value":137},{"type":47,"value":1901}," (writes ",{"type":41,"tag":84,"props":1903,"children":1905},{"className":1904},[],[1906],{"type":47,"value":1907},"placeholder",{"type":47,"value":1909},"), edit ",{"type":41,"tag":84,"props":1911,"children":1913},{"className":1912},[],[1914],{"type":47,"value":115},{"type":47,"value":1916},", self-emit, then ",{"type":41,"tag":84,"props":1918,"children":1920},{"className":1919},[],[1921],{"type":47,"value":145},{"type":41,"tag":1439,"props":1923,"children":1924},{},[1925,1930],{"type":41,"tag":84,"props":1926,"children":1928},{"className":1927},[],[1929],{"type":47,"value":129},{"type":47,"value":1931}," does not author data transforms; the formal path does.",{"type":41,"tag":1412,"props":1933,"children":1934},{},[1935,1940,1963],{"type":41,"tag":1439,"props":1936,"children":1937},{},[1938],{"type":47,"value":1939},"Recovering from drift (DB diverged from contract)",{"type":41,"tag":1439,"props":1941,"children":1942},{},[1943,1948,1950,1955,1956,1961],{"type":41,"tag":84,"props":1944,"children":1946},{"className":1945},[],[1947],{"type":47,"value":994},{"type":47,"value":1949}," after manual fix, ",{"type":41,"tag":255,"props":1951,"children":1952},{},[1953],{"type":47,"value":1954},"or",{"type":47,"value":610},{"type":41,"tag":84,"props":1957,"children":1959},{"className":1958},[],[1960],{"type":47,"value":137},{"type":47,"value":1962}," if PN can plan the fix",{"type":41,"tag":1439,"props":1964,"children":1965},{},[1966,1968,1973],{"type":47,"value":1967},"Depends on which side is right. See ",{"type":41,"tag":255,"props":1969,"children":1970},{},[1971],{"type":47,"value":1972},"Recover from drift",{"type":47,"value":1974}," below.",{"type":41,"tag":203,"props":1976,"children":1978},{"id":1977},"dev-ship-transition-the-db-ref-pattern",[1979,1981,1987],{"type":47,"value":1980},"Dev → ship transition (the ",{"type":41,"tag":84,"props":1982,"children":1984},{"className":1983},[],[1985],{"type":47,"value":1986},"db",{"type":47,"value":1988}," ref pattern)",{"type":41,"tag":54,"props":1990,"children":1991},{},[1992,1994,1999],{"type":47,"value":1993},"Example — iterate locally with ",{"type":41,"tag":84,"props":1995,"children":1997},{"className":1996},[],[1998],{"type":47,"value":129},{"type":47,"value":2000},", then publish the first real migration:",{"type":41,"tag":2002,"props":2003,"children":2008},"pre",{"className":2004,"code":2005,"language":2006,"meta":2007,"style":2007},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","pnpm prisma-next db init --db $DATABASE_URL\npnpm prisma-next contract emit && pnpm prisma-next db update --db $DATABASE_URL\npnpm prisma-next contract emit && pnpm prisma-next migration plan --name add_feature\npnpm prisma-next migrate --db $DATABASE_URL\npnpm prisma-next db verify --db $DATABASE_URL\n","bash","",[2009],{"type":41,"tag":84,"props":2010,"children":2011},{"__ignoreMap":2007},[2012,2051,2105,2157,2182],{"type":41,"tag":2013,"props":2014,"children":2017},"span",{"class":2015,"line":2016},"line",1,[2018,2024,2030,2035,2040,2045],{"type":41,"tag":2013,"props":2019,"children":2021},{"style":2020},"--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B",[2022],{"type":47,"value":2023},"pnpm",{"type":41,"tag":2013,"props":2025,"children":2027},{"style":2026},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[2028],{"type":47,"value":2029}," prisma-next",{"type":41,"tag":2013,"props":2031,"children":2032},{"style":2026},[2033],{"type":47,"value":2034}," db",{"type":41,"tag":2013,"props":2036,"children":2037},{"style":2026},[2038],{"type":47,"value":2039}," init",{"type":41,"tag":2013,"props":2041,"children":2042},{"style":2026},[2043],{"type":47,"value":2044}," --db",{"type":41,"tag":2013,"props":2046,"children":2048},{"style":2047},"--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8",[2049],{"type":47,"value":2050}," $DATABASE_URL\n",{"type":41,"tag":2013,"props":2052,"children":2054},{"class":2015,"line":2053},2,[2055,2059,2063,2068,2073,2079,2084,2088,2092,2097,2101],{"type":41,"tag":2013,"props":2056,"children":2057},{"style":2020},[2058],{"type":47,"value":2023},{"type":41,"tag":2013,"props":2060,"children":2061},{"style":2026},[2062],{"type":47,"value":2029},{"type":41,"tag":2013,"props":2064,"children":2065},{"style":2026},[2066],{"type":47,"value":2067}," contract",{"type":41,"tag":2013,"props":2069,"children":2070},{"style":2026},[2071],{"type":47,"value":2072}," emit",{"type":41,"tag":2013,"props":2074,"children":2076},{"style":2075},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF",[2077],{"type":47,"value":2078}," &&",{"type":41,"tag":2013,"props":2080,"children":2081},{"style":2020},[2082],{"type":47,"value":2083}," pnpm",{"type":41,"tag":2013,"props":2085,"children":2086},{"style":2026},[2087],{"type":47,"value":2029},{"type":41,"tag":2013,"props":2089,"children":2090},{"style":2026},[2091],{"type":47,"value":2034},{"type":41,"tag":2013,"props":2093,"children":2094},{"style":2026},[2095],{"type":47,"value":2096}," update",{"type":41,"tag":2013,"props":2098,"children":2099},{"style":2026},[2100],{"type":47,"value":2044},{"type":41,"tag":2013,"props":2102,"children":2103},{"style":2047},[2104],{"type":47,"value":2050},{"type":41,"tag":2013,"props":2106,"children":2108},{"class":2015,"line":2107},3,[2109,2113,2117,2121,2125,2129,2133,2137,2142,2147,2152],{"type":41,"tag":2013,"props":2110,"children":2111},{"style":2020},[2112],{"type":47,"value":2023},{"type":41,"tag":2013,"props":2114,"children":2115},{"style":2026},[2116],{"type":47,"value":2029},{"type":41,"tag":2013,"props":2118,"children":2119},{"style":2026},[2120],{"type":47,"value":2067},{"type":41,"tag":2013,"props":2122,"children":2123},{"style":2026},[2124],{"type":47,"value":2072},{"type":41,"tag":2013,"props":2126,"children":2127},{"style":2075},[2128],{"type":47,"value":2078},{"type":41,"tag":2013,"props":2130,"children":2131},{"style":2020},[2132],{"type":47,"value":2083},{"type":41,"tag":2013,"props":2134,"children":2135},{"style":2026},[2136],{"type":47,"value":2029},{"type":41,"tag":2013,"props":2138,"children":2139},{"style":2026},[2140],{"type":47,"value":2141}," migration",{"type":41,"tag":2013,"props":2143,"children":2144},{"style":2026},[2145],{"type":47,"value":2146}," plan",{"type":41,"tag":2013,"props":2148,"children":2149},{"style":2026},[2150],{"type":47,"value":2151}," --name",{"type":41,"tag":2013,"props":2153,"children":2154},{"style":2026},[2155],{"type":47,"value":2156}," add_feature\n",{"type":41,"tag":2013,"props":2158,"children":2160},{"class":2015,"line":2159},4,[2161,2165,2169,2174,2178],{"type":41,"tag":2013,"props":2162,"children":2163},{"style":2020},[2164],{"type":47,"value":2023},{"type":41,"tag":2013,"props":2166,"children":2167},{"style":2026},[2168],{"type":47,"value":2029},{"type":41,"tag":2013,"props":2170,"children":2171},{"style":2026},[2172],{"type":47,"value":2173}," migrate",{"type":41,"tag":2013,"props":2175,"children":2176},{"style":2026},[2177],{"type":47,"value":2044},{"type":41,"tag":2013,"props":2179,"children":2180},{"style":2047},[2181],{"type":47,"value":2050},{"type":41,"tag":2013,"props":2183,"children":2185},{"class":2015,"line":2184},5,[2186,2190,2194,2198,2203,2207],{"type":41,"tag":2013,"props":2187,"children":2188},{"style":2020},[2189],{"type":47,"value":2023},{"type":41,"tag":2013,"props":2191,"children":2192},{"style":2026},[2193],{"type":47,"value":2029},{"type":41,"tag":2013,"props":2195,"children":2196},{"style":2026},[2197],{"type":47,"value":2034},{"type":41,"tag":2013,"props":2199,"children":2200},{"style":2026},[2201],{"type":47,"value":2202}," verify",{"type":41,"tag":2013,"props":2204,"children":2205},{"style":2026},[2206],{"type":47,"value":2044},{"type":41,"tag":2013,"props":2208,"children":2209},{"style":2047},[2210],{"type":47,"value":2050},{"type":41,"tag":54,"props":2212,"children":2213},{},[2214,2215,2220,2222,2228,2230,2236,2238,2243],{"type":47,"value":435},{"type":41,"tag":84,"props":2216,"children":2218},{"className":2217},[],[2219],{"type":47,"value":1986},{"type":47,"value":2221}," ref is a named pointer at ",{"type":41,"tag":84,"props":2223,"children":2225},{"className":2224},[],[2226],{"type":47,"value":2227},"migrations\u002Fapp\u002Frefs\u002Fdb.json",{"type":47,"value":2229}," — just ",{"type":41,"tag":84,"props":2231,"children":2233},{"className":2232},[],[2234],{"type":47,"value":2235},"{ hash, invariants }",{"type":47,"value":2237},". It records which contract hash the project's dev database has been brought up to — the offline planner's stand-in for \"where is my local DB?\" without opening a connection at plan time. The contract it names resolves through the shared content-addressed store at ",{"type":41,"tag":84,"props":2239,"children":2241},{"className":2240},[],[2242],{"type":47,"value":623},{"type":47,"value":2244}," by that hash, the same store every migration graph node resolves through.",{"type":41,"tag":54,"props":2246,"children":2247},{},[2248,2266,2268,2274,2276,2281,2283,2288,2290,2296,2298,2304,2306,2312],{"type":41,"tag":58,"props":2249,"children":2250},{},[2251,2253,2258,2259,2264],{"type":47,"value":2252},"What ",{"type":41,"tag":84,"props":2254,"children":2256},{"className":2255},[],[2257],{"type":47,"value":488},{"type":47,"value":482},{"type":41,"tag":84,"props":2260,"children":2262},{"className":2261},[],[2263],{"type":47,"value":129},{"type":47,"value":2265}," write.",{"type":47,"value":2267}," When run against the project's default ",{"type":41,"tag":84,"props":2269,"children":2271},{"className":2270},[],[2272],{"type":47,"value":2273},"--db",{"type":47,"value":2275}," URL (no explicit ",{"type":41,"tag":84,"props":2277,"children":2279},{"className":2278},[],[2280],{"type":47,"value":2273},{"type":47,"value":2282}," flag), both commands implicitly advance the ",{"type":41,"tag":84,"props":2284,"children":2286},{"className":2285},[],[2287],{"type":47,"value":1986},{"type":47,"value":2289}," ref: they write-if-absent the post-command contract IR into the snapshot store, then write the ref's pointer. Override the ref name with ",{"type":41,"tag":84,"props":2291,"children":2293},{"className":2292},[],[2294],{"type":47,"value":2295},"--advance-ref \u003Cname>",{"type":47,"value":2297},". When you pass ",{"type":41,"tag":84,"props":2299,"children":2301},{"className":2300},[],[2302],{"type":47,"value":2303},"--db \u003Cnon-default-url>",{"type":47,"value":2305},", ref advancement is suppressed unless ",{"type":41,"tag":84,"props":2307,"children":2309},{"className":2308},[],[2310],{"type":47,"value":2311},"--advance-ref",{"type":47,"value":2313}," is explicit — reconciling a different database is not the same as checkpointing this project's dev state.",{"type":41,"tag":54,"props":2315,"children":2316},{},[2317],{"type":47,"value":2318},"The on-disk layout is just the pointer:",{"type":41,"tag":2002,"props":2320,"children":2324},{"className":2321,"code":2323,"language":47,"meta":2007},[2322],"language-text","migrations\u002Fapp\u002Frefs\u002F\n└── db.json                 # { \"hash\": \"\u003Chex>\", \"invariants\": [] }\n",[2325],{"type":41,"tag":84,"props":2326,"children":2327},{"__ignoreMap":2007},[2328],{"type":47,"value":2323},{"type":41,"tag":54,"props":2330,"children":2331},{},[2332,2344,2345,2350,2352,2358,2360,2365,2367,2372,2374,2379,2381,2386,2388,2393],{"type":41,"tag":58,"props":2333,"children":2334},{},[2335,2337,2342],{"type":47,"value":2336},"First ",{"type":41,"tag":84,"props":2338,"children":2340},{"className":2339},[],[2341],{"type":47,"value":137},{"type":47,"value":2343}," after dev iteration.",{"type":47,"value":610},{"type":41,"tag":84,"props":2346,"children":2348},{"className":2347},[],[2349],{"type":47,"value":137},{"type":47,"value":2351}," defaults ",{"type":41,"tag":84,"props":2353,"children":2355},{"className":2354},[],[2356],{"type":47,"value":2357},"--from",{"type":47,"value":2359}," to the ",{"type":41,"tag":84,"props":2361,"children":2363},{"className":2362},[],[2364],{"type":47,"value":1986},{"type":47,"value":2366}," ref. When the on-disk migration graph is still ",{"type":41,"tag":58,"props":2368,"children":2369},{},[2370],{"type":47,"value":2371},"empty",{"type":47,"value":2373}," and the ",{"type":41,"tag":84,"props":2375,"children":2377},{"className":2376},[],[2378],{"type":47,"value":1986},{"type":47,"value":2380}," ref points at a non-null hash with a store entry (typical after one or more ",{"type":41,"tag":84,"props":2382,"children":2384},{"className":2383},[],[2385],{"type":47,"value":129},{"type":47,"value":2387}," cycles), the planner emits ",{"type":41,"tag":58,"props":2389,"children":2390},{},[2391],{"type":47,"value":2392},"two",{"type":47,"value":2394}," bundles instead of one:",{"type":41,"tag":69,"props":2396,"children":2397},{},[2398,2419],{"type":41,"tag":73,"props":2399,"children":2400},{},[2401,2403,2409,2411,2417],{"type":47,"value":2402},"Baseline: ",{"type":41,"tag":84,"props":2404,"children":2406},{"className":2405},[],[2407],{"type":47,"value":2408},"null → from-hash",{"type":47,"value":2410}," (introduces ",{"type":41,"tag":84,"props":2412,"children":2414},{"className":2413},[],[2415],{"type":47,"value":2416},"from-hash",{"type":47,"value":2418}," as a graph node)",{"type":41,"tag":73,"props":2420,"children":2421},{},[2422,2424],{"type":47,"value":2423},"Delta: ",{"type":41,"tag":84,"props":2425,"children":2427},{"className":2426},[],[2428],{"type":47,"value":2429},"from-hash → current_contract",{"type":41,"tag":54,"props":2431,"children":2432},{},[2433,2435,2441,2442,2447,2449,2455],{"type":47,"value":2434},"Both land on disk in one invocation — expect two new directories in ",{"type":41,"tag":84,"props":2436,"children":2438},{"className":2437},[],[2439],{"type":47,"value":2440},"git status",{"type":47,"value":886},{"type":41,"tag":84,"props":2443,"children":2445},{"className":2444},[],[2446],{"type":47,"value":145},{"type":47,"value":2448}," then finds a path through the baseline and applies the delta. This closes the dev → ship trap where a single-bundle plan referenced a hash that was not yet a graph node and produced an unapplyable migration (",{"type":41,"tag":84,"props":2450,"children":2452},{"className":2451},[],[2453],{"type":47,"value":2454},"MIGRATION.PATH_UNREACHABLE",{"type":47,"value":2456}," at apply time).",{"type":41,"tag":54,"props":2458,"children":2459},{},[2460,2465,2467,2472,2474,2479,2481,2486,2488,2493,2495,2500,2502,2508],{"type":41,"tag":58,"props":2461,"children":2462},{},[2463],{"type":47,"value":2464},"The forgot-the-flag pitfall.",{"type":47,"value":2466}," After the graph is ",{"type":41,"tag":58,"props":2468,"children":2469},{},[2470],{"type":47,"value":2471},"non-empty",{"type":47,"value":2473},", the default ",{"type":41,"tag":84,"props":2475,"children":2477},{"className":2476},[],[2478],{"type":47,"value":1986},{"type":47,"value":2480}," ref may point ",{"type":41,"tag":58,"props":2482,"children":2483},{},[2484],{"type":47,"value":2485},"past the graph tip",{"type":47,"value":2487}," (the ref advanced on every ",{"type":41,"tag":84,"props":2489,"children":2491},{"className":2490},[],[2492],{"type":47,"value":129},{"type":47,"value":2494}," while you iterated, but you never committed migrations). The next implicit-default ",{"type":41,"tag":84,"props":2496,"children":2498},{"className":2497},[],[2499],{"type":47,"value":137},{"type":47,"value":2501}," refuses with ",{"type":41,"tag":84,"props":2503,"children":2505},{"className":2504},[],[2506],{"type":47,"value":2507},"MIGRATION.HASH_NOT_IN_GRAPH",{"type":47,"value":2509}," and names reachable refs that point at graph nodes.",{"type":41,"tag":54,"props":2511,"children":2512},{},[2513,2515,2520],{"type":47,"value":2514},"Recovery when you see ",{"type":41,"tag":84,"props":2516,"children":2518},{"className":2517},[],[2519],{"type":47,"value":2507},{"type":47,"value":2521}," on plan:",{"type":41,"tag":2002,"props":2523,"children":2525},{"className":2004,"code":2524,"language":2006,"meta":2007,"style":2007},"# Option A — plan from a graph node explicitly\npnpm prisma-next migration plan --from production --name my_change\n\n# Option B — realign the db ref to a graph-node hash, then plan with the default\npnpm prisma-next ref set db \u003Cgraph-node-hash>\npnpm prisma-next migration plan --name my_change\n",[2526],{"type":41,"tag":84,"props":2527,"children":2528},{"__ignoreMap":2007},[2529,2538,2576,2585,2593,2638],{"type":41,"tag":2013,"props":2530,"children":2531},{"class":2015,"line":2016},[2532],{"type":41,"tag":2013,"props":2533,"children":2535},{"style":2534},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic",[2536],{"type":47,"value":2537},"# Option A — plan from a graph node explicitly\n",{"type":41,"tag":2013,"props":2539,"children":2540},{"class":2015,"line":2053},[2541,2545,2549,2553,2557,2562,2567,2571],{"type":41,"tag":2013,"props":2542,"children":2543},{"style":2020},[2544],{"type":47,"value":2023},{"type":41,"tag":2013,"props":2546,"children":2547},{"style":2026},[2548],{"type":47,"value":2029},{"type":41,"tag":2013,"props":2550,"children":2551},{"style":2026},[2552],{"type":47,"value":2141},{"type":41,"tag":2013,"props":2554,"children":2555},{"style":2026},[2556],{"type":47,"value":2146},{"type":41,"tag":2013,"props":2558,"children":2559},{"style":2026},[2560],{"type":47,"value":2561}," --from",{"type":41,"tag":2013,"props":2563,"children":2564},{"style":2026},[2565],{"type":47,"value":2566}," production",{"type":41,"tag":2013,"props":2568,"children":2569},{"style":2026},[2570],{"type":47,"value":2151},{"type":41,"tag":2013,"props":2572,"children":2573},{"style":2026},[2574],{"type":47,"value":2575}," my_change\n",{"type":41,"tag":2013,"props":2577,"children":2578},{"class":2015,"line":2107},[2579],{"type":41,"tag":2013,"props":2580,"children":2582},{"emptyLinePlaceholder":2581},true,[2583],{"type":47,"value":2584},"\n",{"type":41,"tag":2013,"props":2586,"children":2587},{"class":2015,"line":2159},[2588],{"type":41,"tag":2013,"props":2589,"children":2590},{"style":2534},[2591],{"type":47,"value":2592},"# Option B — realign the db ref to a graph-node hash, then plan with the default\n",{"type":41,"tag":2013,"props":2594,"children":2595},{"class":2015,"line":2184},[2596,2600,2604,2609,2614,2618,2623,2628,2633],{"type":41,"tag":2013,"props":2597,"children":2598},{"style":2020},[2599],{"type":47,"value":2023},{"type":41,"tag":2013,"props":2601,"children":2602},{"style":2026},[2603],{"type":47,"value":2029},{"type":41,"tag":2013,"props":2605,"children":2606},{"style":2026},[2607],{"type":47,"value":2608}," ref",{"type":41,"tag":2013,"props":2610,"children":2611},{"style":2026},[2612],{"type":47,"value":2613}," set",{"type":41,"tag":2013,"props":2615,"children":2616},{"style":2026},[2617],{"type":47,"value":2034},{"type":41,"tag":2013,"props":2619,"children":2620},{"style":2075},[2621],{"type":47,"value":2622}," \u003C",{"type":41,"tag":2013,"props":2624,"children":2625},{"style":2026},[2626],{"type":47,"value":2627},"graph-node-has",{"type":41,"tag":2013,"props":2629,"children":2630},{"style":2047},[2631],{"type":47,"value":2632},"h",{"type":41,"tag":2013,"props":2634,"children":2635},{"style":2075},[2636],{"type":47,"value":2637},">\n",{"type":41,"tag":2013,"props":2639,"children":2641},{"class":2015,"line":2640},6,[2642,2646,2650,2654,2658,2662],{"type":41,"tag":2013,"props":2643,"children":2644},{"style":2020},[2645],{"type":47,"value":2023},{"type":41,"tag":2013,"props":2647,"children":2648},{"style":2026},[2649],{"type":47,"value":2029},{"type":41,"tag":2013,"props":2651,"children":2652},{"style":2026},[2653],{"type":47,"value":2141},{"type":41,"tag":2013,"props":2655,"children":2656},{"style":2026},[2657],{"type":47,"value":2146},{"type":41,"tag":2013,"props":2659,"children":2660},{"style":2026},[2661],{"type":47,"value":2151},{"type":41,"tag":2013,"props":2663,"children":2664},{"style":2026},[2665],{"type":47,"value":2575},{"type":41,"tag":54,"props":2667,"children":2668},{},[2669,2671,2676,2678,2684,2686,2692,2694,2700],{"type":47,"value":2670},"If the ",{"type":41,"tag":84,"props":2672,"children":2674},{"className":2673},[],[2675],{"type":47,"value":1986},{"type":47,"value":2677}," ref's pointer is itself missing and the hash isn't a graph node either (",{"type":41,"tag":84,"props":2679,"children":2681},{"className":2680},[],[2682],{"type":47,"value":2683},"MIGRATION.SNAPSHOT_MISSING",{"type":47,"value":2685},"), create it with ",{"type":41,"tag":84,"props":2687,"children":2689},{"className":2688},[],[2690],{"type":47,"value":2691},"ref set db \u003Chash>",{"type":47,"value":2693}," or advance it with ",{"type":41,"tag":84,"props":2695,"children":2697},{"className":2696},[],[2698],{"type":47,"value":2699},"db update --advance-ref db",{"type":47,"value":276},{"type":41,"tag":54,"props":2702,"children":2703},{},[2704,2715,2716,2721,2723,2728,2730,2735,2737,2743],{"type":41,"tag":58,"props":2705,"children":2706},{},[2707,2709,2714],{"type":47,"value":2708},"After plain ",{"type":41,"tag":84,"props":2710,"children":2712},{"className":2711},[],[2713],{"type":47,"value":145},{"type":47,"value":276},{"type":47,"value":610},{"type":41,"tag":84,"props":2717,"children":2719},{"className":2718},[],[2720],{"type":47,"value":145},{"type":47,"value":2722}," does not implicitly advance the ",{"type":41,"tag":84,"props":2724,"children":2726},{"className":2725},[],[2727],{"type":47,"value":1986},{"type":47,"value":2729}," ref (production-shaped commands stay explicit). The live marker advances while the ref may lag. Refresh with ",{"type":41,"tag":84,"props":2731,"children":2733},{"className":2732},[],[2734],{"type":47,"value":129},{"type":47,"value":2736}," (no-op on DB when already current) or ",{"type":41,"tag":84,"props":2738,"children":2740},{"className":2739},[],[2741],{"type":47,"value":2742},"migrate --advance-ref db",{"type":47,"value":2744}," in the same invocation.",{"type":41,"tag":54,"props":2746,"children":2747},{},[2748,2753,2755,2760,2762,2767,2768,2773,2775,2780],{"type":41,"tag":58,"props":2749,"children":2750},{},[2751],{"type":47,"value":2752},"When to switch paths.",{"type":47,"value":2754}," Use ",{"type":41,"tag":84,"props":2756,"children":2758},{"className":2757},[],[2759],{"type":47,"value":129},{"type":47,"value":2761}," while the schema is in flux on a solo dev database. Switch to ",{"type":41,"tag":84,"props":2763,"children":2765},{"className":2764},[],[2766],{"type":47,"value":137},{"type":47,"value":139},{"type":41,"tag":84,"props":2769,"children":2771},{"className":2770},[],[2772],{"type":47,"value":145},{"type":47,"value":2774}," when the change needs a reviewable, replayable migration — typically before opening a PR or touching any shared environment. The ",{"type":41,"tag":84,"props":2776,"children":2778},{"className":2777},[],[2779],{"type":47,"value":1986},{"type":47,"value":2781}," ref bridges the two: it captures dev iteration state on disk so the first formal plan knows where you left off.",{"type":41,"tag":54,"props":2783,"children":2784},{},[2785,2790,2792,2798,2800,2805,2807,2812,2814,2818,2820,2825,2827,2832],{"type":41,"tag":58,"props":2786,"children":2787},{},[2788],{"type":47,"value":2789},"Graph-node rule (plan time).",{"type":47,"value":2791}," Any hash used as a ",{"type":41,"tag":84,"props":2793,"children":2795},{"className":2794},[],[2796],{"type":47,"value":2797},"from",{"type":47,"value":2799}," end — explicit ",{"type":41,"tag":84,"props":2801,"children":2803},{"className":2802},[],[2804],{"type":47,"value":2357},{"type":47,"value":2806},", default ",{"type":41,"tag":84,"props":2808,"children":2810},{"className":2809},[],[2811],{"type":47,"value":1986},{"type":47,"value":2813}," ref, or ref name — must already be a node in the on-disk migration graph once the graph is non-empty. The auto-baseline two-bundle emission is the one exception: it applies only on an ",{"type":41,"tag":58,"props":2815,"children":2816},{},[2817],{"type":47,"value":2371},{"type":47,"value":2819}," graph with a non-null ref-resolved ",{"type":41,"tag":84,"props":2821,"children":2823},{"className":2822},[],[2824],{"type":47,"value":2797},{"type":47,"value":2826}," and an available store entry. If the ref's pointer is missing and the hash isn't a graph node either, plan refuses with ",{"type":41,"tag":84,"props":2828,"children":2830},{"className":2829},[],[2831],{"type":47,"value":2683},{"type":47,"value":2833}," instead.",{"type":41,"tag":54,"props":2835,"children":2836},{},[2837,2842,2843,2848,2850,2856,2858,2864,2866,2871],{"type":41,"tag":58,"props":2838,"children":2839},{},[2840],{"type":47,"value":2841},"Apply-time complement.",{"type":47,"value":610},{"type":41,"tag":84,"props":2844,"children":2846},{"className":2845},[],[2847],{"type":47,"value":145},{"type":47,"value":2849}," reads the live marker before DDL. If the marker hash is not a graph node, the command refuses with ",{"type":41,"tag":84,"props":2851,"children":2853},{"className":2852},[],[2854],{"type":47,"value":2855},"MIGRATION.MARKER_MISMATCH",{"type":47,"value":2857}," — catching drift the offline planner cannot see. This is separate from ",{"type":41,"tag":84,"props":2859,"children":2861},{"className":2860},[],[2862],{"type":47,"value":2863},"MIGRATION.MARKER_NOT_IN_HISTORY",{"type":47,"value":2865},", which fires later during the runner's graph walk when the marker is off the path being traversed. See ",{"type":41,"tag":84,"props":2867,"children":2869},{"className":2868},[],[2870],{"type":47,"value":303},{"type":47,"value":2872}," for the full diagnostic catalog.",{"type":41,"tag":54,"props":2874,"children":2875},{},[2876,2881,2883,2888,2890,2895,2897,2902],{"type":41,"tag":84,"props":2877,"children":2879},{"className":2878},[],[2880],{"type":47,"value":1986},{"type":47,"value":2882}," is a ",{"type":41,"tag":58,"props":2884,"children":2885},{},[2886],{"type":47,"value":2887},"default ref name",{"type":47,"value":2889},", not a reserved one. The framework overwrites it on the next dev cycle; you may ",{"type":41,"tag":84,"props":2891,"children":2893},{"className":2892},[],[2894],{"type":47,"value":2691},{"type":47,"value":2896}," explicitly and accept that a subsequent ",{"type":41,"tag":84,"props":2898,"children":2900},{"className":2899},[],[2901],{"type":47,"value":129},{"type":47,"value":2903}," replaces it when run against the default URL.",{"type":41,"tag":54,"props":2905,"children":2906},{},[2907,2909,2916,2917,2928,2929,2935,2936,2942,2944,2950],{"type":47,"value":2908},"Canonical detail: ",{"type":41,"tag":2910,"props":2911,"children":2913},"a",{"href":2912},"..\u002F..\u002Fdocs\u002Farchitecture%20docs\u002Fsubsystems\u002F7.%20Migration%20System.md#contract-resolution-through-the-snapshot-store",[2914],{"type":47,"value":2915},"Migration System § Contract resolution through the snapshot store",{"type":47,"value":240},{"type":41,"tag":2910,"props":2918,"children":2920},{"href":2919},"..\u002F..\u002Fdocs\u002Farchitecture%20docs\u002Fsubsystems\u002F7.%20Migration%20System.md#migration-plan",[2921,2923],{"type":47,"value":2922},"§ ",{"type":41,"tag":84,"props":2924,"children":2926},{"className":2925},[],[2927],{"type":47,"value":137},{"type":47,"value":240},{"type":41,"tag":2910,"props":2930,"children":2932},{"href":2931},"..\u002F..\u002Fdocs\u002Farchitecture%20docs\u002Fsubsystems\u002F7.%20Migration%20System.md#recovery-affordances",[2933],{"type":47,"value":2934},"§ Recovery affordances",{"type":47,"value":240},{"type":41,"tag":2910,"props":2937,"children":2939},{"href":2938},"..\u002F..\u002Fdocs\u002Farchitecture%20docs\u002Fadrs\u002FADR%20218%20-%20Refs%20with%20paired%20contract%20snapshots%20and%20universal%20graph-node%20invariant.md",[2940],{"type":47,"value":2941},"ADR 218 — Refs with paired contract snapshots and universal graph-node invariant",{"type":47,"value":2943}," (TML-2629, its paired-snapshot part superseded — see the ADR's Status note), and ",{"type":41,"tag":2910,"props":2945,"children":2947},{"href":2946},"..\u002F..\u002Fdocs\u002Farchitecture%20docs\u002Fadrs\u002FADR%20240%20-%20Contract%20snapshots%20live%20in%20a%20content-addressed%20store.md",[2948],{"type":47,"value":2949},"ADR 240 — Contract snapshots live in a content-addressed store",{"type":47,"value":276},{"type":41,"tag":203,"props":2952,"children":2954},{"id":2953},"workflow-db-update-quick-path",[2955,2957,2962],{"type":47,"value":2956},"Workflow — ",{"type":41,"tag":84,"props":2958,"children":2960},{"className":2959},[],[2961],{"type":47,"value":129},{"type":47,"value":2963}," (quick path)",{"type":41,"tag":54,"props":2965,"children":2966},{},[2967,2969,2974,2976,2982,2984,2989,2991,2996,2998,3004,3006,3011,3013,3018,3020,3025],{"type":47,"value":2968},"The concept: ",{"type":41,"tag":84,"props":2970,"children":2972},{"className":2971},[],[2973],{"type":47,"value":129},{"type":47,"value":2975}," resolves the destination (",{"type":41,"tag":84,"props":2977,"children":2979},{"className":2978},[],[2980],{"type":47,"value":2981},"emitted contract",{"type":47,"value":2983},") against the live DB and applies the difference. Preview with ",{"type":41,"tag":84,"props":2985,"children":2987},{"className":2986},[],[2988],{"type":47,"value":357},{"type":47,"value":2990},". Destructive ops prompt interactively unless you pass ",{"type":41,"tag":84,"props":2992,"children":2994},{"className":2993},[],[2995],{"type":47,"value":365},{"type":47,"value":2997}," or ",{"type":41,"tag":84,"props":2999,"children":3001},{"className":3000},[],[3002],{"type":47,"value":3003},"--no-interactive",{"type":47,"value":3005},". The path excludes operations of the ",{"type":41,"tag":84,"props":3007,"children":3009},{"className":3008},[],[3010],{"type":47,"value":387},{"type":47,"value":3012}," class entirely — if the diff requires a data transform, ",{"type":41,"tag":84,"props":3014,"children":3016},{"className":3015},[],[3017],{"type":47,"value":129},{"type":47,"value":3019}," fails with a planning error and you switch to ",{"type":41,"tag":84,"props":3021,"children":3023},{"className":3022},[],[3024],{"type":47,"value":137},{"type":47,"value":3026}," to author the transform.",{"type":41,"tag":54,"props":3028,"children":3029},{},[3030],{"type":47,"value":3031},"Run after a contract edit:",{"type":41,"tag":2002,"props":3033,"children":3035},{"className":2004,"code":3034,"language":2006,"meta":2007,"style":2007},"pnpm prisma-next contract emit\n# Postgres: --db postgresql:\u002F\u002F...\n# Mongo:    --db mongodb:\u002F\u002F...  (dev scaffolds often need ?replicaSet=rs0)\npnpm prisma-next db update --db $DATABASE_URL --dry-run\npnpm prisma-next db update --db $DATABASE_URL\n",[3036],{"type":41,"tag":84,"props":3037,"children":3038},{"__ignoreMap":2007},[3039,3059,3067,3075,3108],{"type":41,"tag":2013,"props":3040,"children":3041},{"class":2015,"line":2016},[3042,3046,3050,3054],{"type":41,"tag":2013,"props":3043,"children":3044},{"style":2020},[3045],{"type":47,"value":2023},{"type":41,"tag":2013,"props":3047,"children":3048},{"style":2026},[3049],{"type":47,"value":2029},{"type":41,"tag":2013,"props":3051,"children":3052},{"style":2026},[3053],{"type":47,"value":2067},{"type":41,"tag":2013,"props":3055,"children":3056},{"style":2026},[3057],{"type":47,"value":3058}," emit\n",{"type":41,"tag":2013,"props":3060,"children":3061},{"class":2015,"line":2053},[3062],{"type":41,"tag":2013,"props":3063,"children":3064},{"style":2534},[3065],{"type":47,"value":3066},"# Postgres: --db postgresql:\u002F\u002F...\n",{"type":41,"tag":2013,"props":3068,"children":3069},{"class":2015,"line":2107},[3070],{"type":41,"tag":2013,"props":3071,"children":3072},{"style":2534},[3073],{"type":47,"value":3074},"# Mongo:    --db mongodb:\u002F\u002F...  (dev scaffolds often need ?replicaSet=rs0)\n",{"type":41,"tag":2013,"props":3076,"children":3077},{"class":2015,"line":2159},[3078,3082,3086,3090,3094,3098,3103],{"type":41,"tag":2013,"props":3079,"children":3080},{"style":2020},[3081],{"type":47,"value":2023},{"type":41,"tag":2013,"props":3083,"children":3084},{"style":2026},[3085],{"type":47,"value":2029},{"type":41,"tag":2013,"props":3087,"children":3088},{"style":2026},[3089],{"type":47,"value":2034},{"type":41,"tag":2013,"props":3091,"children":3092},{"style":2026},[3093],{"type":47,"value":2096},{"type":41,"tag":2013,"props":3095,"children":3096},{"style":2026},[3097],{"type":47,"value":2044},{"type":41,"tag":2013,"props":3099,"children":3100},{"style":2047},[3101],{"type":47,"value":3102}," $DATABASE_URL ",{"type":41,"tag":2013,"props":3104,"children":3105},{"style":2026},[3106],{"type":47,"value":3107},"--dry-run\n",{"type":41,"tag":2013,"props":3109,"children":3110},{"class":2015,"line":2184},[3111,3115,3119,3123,3127,3131],{"type":41,"tag":2013,"props":3112,"children":3113},{"style":2020},[3114],{"type":47,"value":2023},{"type":41,"tag":2013,"props":3116,"children":3117},{"style":2026},[3118],{"type":47,"value":2029},{"type":41,"tag":2013,"props":3120,"children":3121},{"style":2026},[3122],{"type":47,"value":2034},{"type":41,"tag":2013,"props":3124,"children":3125},{"style":2026},[3126],{"type":47,"value":2096},{"type":41,"tag":2013,"props":3128,"children":3129},{"style":2026},[3130],{"type":47,"value":2044},{"type":41,"tag":2013,"props":3132,"children":3133},{"style":2047},[3134],{"type":47,"value":2050},{"type":41,"tag":54,"props":3136,"children":3137},{},[3138,3143,3145,3150,3152,3157,3159,3164],{"type":41,"tag":84,"props":3139,"children":3141},{"className":3140},[],[3142],{"type":47,"value":129},{"type":47,"value":3144}," already verifies schema and advances the marker on success — a follow-up ",{"type":41,"tag":84,"props":3146,"children":3148},{"className":3147},[],[3149],{"type":47,"value":1076},{"type":47,"value":3151}," is redundant on the happy path. Use ",{"type":41,"tag":84,"props":3153,"children":3155},{"className":3154},[],[3156],{"type":47,"value":1076},{"type":47,"value":3158}," only when you need a standalone diagnostic (see ",{"type":41,"tag":255,"props":3160,"children":3161},{},[3162],{"type":47,"value":3163},"Verify contract vs DB",{"type":47,"value":530},{"type":41,"tag":54,"props":3166,"children":3167},{},[3168],{"type":47,"value":3169},"Inspect the JSON output to drive the next move:",{"type":41,"tag":2002,"props":3171,"children":3173},{"className":2004,"code":3172,"language":2006,"meta":2007,"style":2007},"pnpm prisma-next db update --db $DATABASE_URL --json\n",[3174],{"type":41,"tag":84,"props":3175,"children":3176},{"__ignoreMap":2007},[3177],{"type":41,"tag":2013,"props":3178,"children":3179},{"class":2015,"line":2016},[3180,3184,3188,3192,3196,3200,3204],{"type":41,"tag":2013,"props":3181,"children":3182},{"style":2020},[3183],{"type":47,"value":2023},{"type":41,"tag":2013,"props":3185,"children":3186},{"style":2026},[3187],{"type":47,"value":2029},{"type":41,"tag":2013,"props":3189,"children":3190},{"style":2026},[3191],{"type":47,"value":2034},{"type":41,"tag":2013,"props":3193,"children":3194},{"style":2026},[3195],{"type":47,"value":2096},{"type":41,"tag":2013,"props":3197,"children":3198},{"style":2026},[3199],{"type":47,"value":2044},{"type":41,"tag":2013,"props":3201,"children":3202},{"style":2047},[3203],{"type":47,"value":3102},{"type":41,"tag":2013,"props":3205,"children":3206},{"style":2026},[3207],{"type":47,"value":3208},"--json\n",{"type":41,"tag":54,"props":3210,"children":3211},{},[3212,3214,3220,3222,3227,3229,3235,3237,3243,3245,3251],{"type":47,"value":3213},"The JSON contains ",{"type":41,"tag":84,"props":3215,"children":3217},{"className":3216},[],[3218],{"type":47,"value":3219},"plan.operations[]",{"type":47,"value":3221}," with each ",{"type":41,"tag":84,"props":3223,"children":3225},{"className":3224},[],[3226],{"type":47,"value":1101},{"type":47,"value":3228},", plus (in apply mode) ",{"type":41,"tag":84,"props":3230,"children":3232},{"className":3231},[],[3233],{"type":47,"value":3234},"execution.operationsExecuted",{"type":47,"value":3236}," and the post-apply ",{"type":41,"tag":84,"props":3238,"children":3240},{"className":3239},[],[3241],{"type":47,"value":3242},"marker.storageHash",{"type":47,"value":3244},". If the command failed because of destructive operations, the error envelope's ",{"type":41,"tag":84,"props":3246,"children":3248},{"className":3247},[],[3249],{"type":47,"value":3250},"meta.destructiveOperations[]",{"type":47,"value":3252}," lists exactly what would have been dropped.",{"type":41,"tag":203,"props":3254,"children":3256},{"id":3255},"workflow-migration-plan-migrate-formal-path",[3257,3258,3263,3264,3269],{"type":47,"value":2956},{"type":41,"tag":84,"props":3259,"children":3261},{"className":3260},[],[3262],{"type":47,"value":137},{"type":47,"value":139},{"type":41,"tag":84,"props":3265,"children":3267},{"className":3266},[],[3268],{"type":47,"value":145},{"type":47,"value":3270}," (formal path)",{"type":41,"tag":54,"props":3272,"children":3273},{},[3274,3275,3280,3282,3287,3289,3294,3296,3301,3303,3308],{"type":47,"value":2968},{"type":41,"tag":84,"props":3276,"children":3278},{"className":3277},[],[3279],{"type":47,"value":137},{"type":47,"value":3281}," writes a new migration package on disk. If the planner needed any data transforms, the package is ",{"type":41,"tag":255,"props":3283,"children":3284},{},[3285],{"type":47,"value":3286},"pending",{"type":47,"value":3288}," — ",{"type":41,"tag":84,"props":3290,"children":3292},{"className":3291},[],[3293],{"type":47,"value":115},{"type":47,"value":3295}," holds ",{"type":41,"tag":84,"props":3297,"children":3299},{"className":3298},[],[3300],{"type":47,"value":425},{"type":47,"value":3302}," calls until you fill them in. ",{"type":41,"tag":84,"props":3304,"children":3306},{"className":3305},[],[3307],{"type":47,"value":145},{"type":47,"value":3309}," runs every pending package in graph order, transactionally.",{"type":41,"tag":54,"props":3311,"children":3312},{},[3313],{"type":47,"value":3314},"Plan a change:",{"type":41,"tag":2002,"props":3316,"children":3318},{"className":2004,"code":3317,"language":2006,"meta":2007,"style":2007},"pnpm prisma-next contract emit\npnpm prisma-next migration plan --name \u003Csnake_slug>\n",[3319],{"type":41,"tag":84,"props":3320,"children":3321},{"__ignoreMap":2007},[3322,3341],{"type":41,"tag":2013,"props":3323,"children":3324},{"class":2015,"line":2016},[3325,3329,3333,3337],{"type":41,"tag":2013,"props":3326,"children":3327},{"style":2020},[3328],{"type":47,"value":2023},{"type":41,"tag":2013,"props":3330,"children":3331},{"style":2026},[3332],{"type":47,"value":2029},{"type":41,"tag":2013,"props":3334,"children":3335},{"style":2026},[3336],{"type":47,"value":2067},{"type":41,"tag":2013,"props":3338,"children":3339},{"style":2026},[3340],{"type":47,"value":3058},{"type":41,"tag":2013,"props":3342,"children":3343},{"class":2015,"line":2053},[3344,3348,3352,3356,3360,3364,3368,3373,3378],{"type":41,"tag":2013,"props":3345,"children":3346},{"style":2020},[3347],{"type":47,"value":2023},{"type":41,"tag":2013,"props":3349,"children":3350},{"style":2026},[3351],{"type":47,"value":2029},{"type":41,"tag":2013,"props":3353,"children":3354},{"style":2026},[3355],{"type":47,"value":2141},{"type":41,"tag":2013,"props":3357,"children":3358},{"style":2026},[3359],{"type":47,"value":2146},{"type":41,"tag":2013,"props":3361,"children":3362},{"style":2026},[3363],{"type":47,"value":2151},{"type":41,"tag":2013,"props":3365,"children":3366},{"style":2075},[3367],{"type":47,"value":2622},{"type":41,"tag":2013,"props":3369,"children":3370},{"style":2026},[3371],{"type":47,"value":3372},"snake_slu",{"type":41,"tag":2013,"props":3374,"children":3375},{"style":2047},[3376],{"type":47,"value":3377},"g",{"type":41,"tag":2013,"props":3379,"children":3380},{"style":2075},[3381],{"type":47,"value":2637},{"type":41,"tag":54,"props":3383,"children":3384},{},[3385],{"type":47,"value":3386},"Read the result. The JSON shape exposes the queryable signals:",{"type":41,"tag":210,"props":3388,"children":3389},{},[3390,3408,3438,3462],{"type":41,"tag":73,"props":3391,"children":3392},{},[3393,3399,3401,3407],{"type":41,"tag":84,"props":3394,"children":3396},{"className":3395},[],[3397],{"type":47,"value":3398},"dir",{"type":47,"value":3400}," — the path of the new package (e.g. ",{"type":41,"tag":84,"props":3402,"children":3404},{"className":3403},[],[3405],{"type":47,"value":3406},"migrations\u002Fapp\u002F20260515T1200_add_user_email\u002F",{"type":47,"value":530},{"type":41,"tag":73,"props":3409,"children":3410},{},[3411,3416,3417,3422,3424,3429,3431,3436],{"type":41,"tag":84,"props":3412,"children":3414},{"className":3413},[],[3415],{"type":47,"value":876},{"type":47,"value":3288},{"type":41,"tag":84,"props":3418,"children":3420},{"className":3419},[],[3421],{"type":47,"value":892},{"type":47,"value":3423}," if ",{"type":41,"tag":84,"props":3425,"children":3427},{"className":3426},[],[3428],{"type":47,"value":115},{"type":47,"value":3430}," still contains ",{"type":41,"tag":84,"props":3432,"children":3434},{"className":3433},[],[3435],{"type":47,"value":425},{"type":47,"value":3437}," calls.",{"type":41,"tag":73,"props":3439,"children":3440},{},[3441,3447,3449,3454,3455,3460],{"type":41,"tag":84,"props":3442,"children":3444},{"className":3443},[],[3445],{"type":47,"value":3446},"operations[].operationClass",{"type":47,"value":3448}," — for spotting ",{"type":41,"tag":84,"props":3450,"children":3452},{"className":3451},[],[3453],{"type":47,"value":1130},{"type":47,"value":131},{"type":41,"tag":84,"props":3456,"children":3458},{"className":3457},[],[3459],{"type":47,"value":387},{"type":47,"value":3461}," ops.",{"type":41,"tag":73,"props":3463,"children":3464},{},[3465,3471],{"type":41,"tag":84,"props":3466,"children":3468},{"className":3467},[],[3469],{"type":47,"value":3470},"preview.statements",{"type":47,"value":3472}," — family-agnostic textual preview.",{"type":41,"tag":54,"props":3474,"children":3475},{},[3476],{"type":47,"value":3477},"Inspect the package:",{"type":41,"tag":2002,"props":3479,"children":3481},{"className":2004,"code":3480,"language":2006,"meta":2007,"style":2007},"pnpm prisma-next migration show\npnpm prisma-next migration show \u003CdirName-or-migrationHash-prefix>\n",[3482],{"type":41,"tag":84,"props":3483,"children":3484},{"__ignoreMap":2007},[3485,3505],{"type":41,"tag":2013,"props":3486,"children":3487},{"class":2015,"line":2016},[3488,3492,3496,3500],{"type":41,"tag":2013,"props":3489,"children":3490},{"style":2020},[3491],{"type":47,"value":2023},{"type":41,"tag":2013,"props":3493,"children":3494},{"style":2026},[3495],{"type":47,"value":2029},{"type":41,"tag":2013,"props":3497,"children":3498},{"style":2026},[3499],{"type":47,"value":2141},{"type":41,"tag":2013,"props":3501,"children":3502},{"style":2026},[3503],{"type":47,"value":3504}," show\n",{"type":41,"tag":2013,"props":3506,"children":3507},{"class":2015,"line":2053},[3508,3512,3516,3520,3525,3529,3534,3539],{"type":41,"tag":2013,"props":3509,"children":3510},{"style":2020},[3511],{"type":47,"value":2023},{"type":41,"tag":2013,"props":3513,"children":3514},{"style":2026},[3515],{"type":47,"value":2029},{"type":41,"tag":2013,"props":3517,"children":3518},{"style":2026},[3519],{"type":47,"value":2141},{"type":41,"tag":2013,"props":3521,"children":3522},{"style":2026},[3523],{"type":47,"value":3524}," show",{"type":41,"tag":2013,"props":3526,"children":3527},{"style":2075},[3528],{"type":47,"value":2622},{"type":41,"tag":2013,"props":3530,"children":3531},{"style":2026},[3532],{"type":47,"value":3533},"dirName-or-migrationHash-prefi",{"type":41,"tag":2013,"props":3535,"children":3536},{"style":2047},[3537],{"type":47,"value":3538},"x",{"type":41,"tag":2013,"props":3540,"children":3541},{"style":2075},[3542],{"type":47,"value":2637},{"type":41,"tag":54,"props":3544,"children":3545},{},[3546,3552,3554,3560],{"type":41,"tag":84,"props":3547,"children":3549},{"className":3548},[],[3550],{"type":47,"value":3551},"migration show",{"type":47,"value":3553}," displays a single migration package. To see the ordered list of migrations that would run — across all contract spaces — use ",{"type":41,"tag":84,"props":3555,"children":3557},{"className":3556},[],[3558],{"type":47,"value":3559},"migrate --show",{"type":47,"value":3561},":",{"type":41,"tag":2002,"props":3563,"children":3565},{"className":2004,"code":3564,"language":2006,"meta":2007,"style":2007},"# Online: reads the live DB marker as the origin.\npnpm prisma-next migrate --show --db $DATABASE_URL\n\n# Offline: hypothetical path from any ref or hash.\npnpm prisma-next migrate --show --from \u003Chash-or-ref> --to \u003Chash-or-ref>\n",[3566],{"type":41,"tag":84,"props":3567,"children":3568},{"__ignoreMap":2007},[3569,3577,3605,3612,3620],{"type":41,"tag":2013,"props":3570,"children":3571},{"class":2015,"line":2016},[3572],{"type":41,"tag":2013,"props":3573,"children":3574},{"style":2534},[3575],{"type":47,"value":3576},"# Online: reads the live DB marker as the origin.\n",{"type":41,"tag":2013,"props":3578,"children":3579},{"class":2015,"line":2053},[3580,3584,3588,3592,3597,3601],{"type":41,"tag":2013,"props":3581,"children":3582},{"style":2020},[3583],{"type":47,"value":2023},{"type":41,"tag":2013,"props":3585,"children":3586},{"style":2026},[3587],{"type":47,"value":2029},{"type":41,"tag":2013,"props":3589,"children":3590},{"style":2026},[3591],{"type":47,"value":2173},{"type":41,"tag":2013,"props":3593,"children":3594},{"style":2026},[3595],{"type":47,"value":3596}," --show",{"type":41,"tag":2013,"props":3598,"children":3599},{"style":2026},[3600],{"type":47,"value":2044},{"type":41,"tag":2013,"props":3602,"children":3603},{"style":2047},[3604],{"type":47,"value":2050},{"type":41,"tag":2013,"props":3606,"children":3607},{"class":2015,"line":2107},[3608],{"type":41,"tag":2013,"props":3609,"children":3610},{"emptyLinePlaceholder":2581},[3611],{"type":47,"value":2584},{"type":41,"tag":2013,"props":3613,"children":3614},{"class":2015,"line":2159},[3615],{"type":41,"tag":2013,"props":3616,"children":3617},{"style":2534},[3618],{"type":47,"value":3619},"# Offline: hypothetical path from any ref or hash.\n",{"type":41,"tag":2013,"props":3621,"children":3622},{"class":2015,"line":2184},[3623,3627,3631,3635,3639,3643,3647,3652,3657,3662,3667,3671,3675,3679],{"type":41,"tag":2013,"props":3624,"children":3625},{"style":2020},[3626],{"type":47,"value":2023},{"type":41,"tag":2013,"props":3628,"children":3629},{"style":2026},[3630],{"type":47,"value":2029},{"type":41,"tag":2013,"props":3632,"children":3633},{"style":2026},[3634],{"type":47,"value":2173},{"type":41,"tag":2013,"props":3636,"children":3637},{"style":2026},[3638],{"type":47,"value":3596},{"type":41,"tag":2013,"props":3640,"children":3641},{"style":2026},[3642],{"type":47,"value":2561},{"type":41,"tag":2013,"props":3644,"children":3645},{"style":2075},[3646],{"type":47,"value":2622},{"type":41,"tag":2013,"props":3648,"children":3649},{"style":2026},[3650],{"type":47,"value":3651},"hash-or-re",{"type":41,"tag":2013,"props":3653,"children":3654},{"style":2047},[3655],{"type":47,"value":3656},"f",{"type":41,"tag":2013,"props":3658,"children":3659},{"style":2075},[3660],{"type":47,"value":3661},">",{"type":41,"tag":2013,"props":3663,"children":3664},{"style":2026},[3665],{"type":47,"value":3666}," --to",{"type":41,"tag":2013,"props":3668,"children":3669},{"style":2075},[3670],{"type":47,"value":2622},{"type":41,"tag":2013,"props":3672,"children":3673},{"style":2026},[3674],{"type":47,"value":3651},{"type":41,"tag":2013,"props":3676,"children":3677},{"style":2047},[3678],{"type":47,"value":3656},{"type":41,"tag":2013,"props":3680,"children":3681},{"style":2075},[3682],{"type":47,"value":2637},{"type":41,"tag":54,"props":3684,"children":3685},{},[3686,3691],{"type":41,"tag":84,"props":3687,"children":3689},{"className":3688},[],[3690],{"type":47,"value":3559},{"type":47,"value":3692}," is read-only and never writes to the DB or the migration graph. Use it before applying to confirm the execution order.",{"type":41,"tag":54,"props":3694,"children":3695},{},[3696,3698,3702,3704,3709],{"type":47,"value":3697},"Fill in any data transforms (see ",{"type":41,"tag":255,"props":3699,"children":3700},{},[3701],{"type":47,"value":585},{"type":47,"value":3703},"), self-emit if you edited ",{"type":41,"tag":84,"props":3705,"children":3707},{"className":3706},[],[3708],{"type":47,"value":115},{"type":47,"value":3710},", then:",{"type":41,"tag":2002,"props":3712,"children":3714},{"className":2004,"code":3713,"language":2006,"meta":2007,"style":2007},"pnpm prisma-next migrate --db $DATABASE_URL\n",[3715],{"type":41,"tag":84,"props":3716,"children":3717},{"__ignoreMap":2007},[3718],{"type":41,"tag":2013,"props":3719,"children":3720},{"class":2015,"line":2016},[3721,3725,3729,3733,3737],{"type":41,"tag":2013,"props":3722,"children":3723},{"style":2020},[3724],{"type":47,"value":2023},{"type":41,"tag":2013,"props":3726,"children":3727},{"style":2026},[3728],{"type":47,"value":2029},{"type":41,"tag":2013,"props":3730,"children":3731},{"style":2026},[3732],{"type":47,"value":2173},{"type":41,"tag":2013,"props":3734,"children":3735},{"style":2026},[3736],{"type":47,"value":2044},{"type":41,"tag":2013,"props":3738,"children":3739},{"style":2047},[3740],{"type":47,"value":2050},{"type":41,"tag":54,"props":3742,"children":3743},{},[3744,3749,3751,3756,3758,3763,3764,3769],{"type":41,"tag":84,"props":3745,"children":3747},{"className":3746},[],[3748],{"type":47,"value":145},{"type":47,"value":3750}," runs without prompting — destructive-op confirmation lives on ",{"type":41,"tag":84,"props":3752,"children":3754},{"className":3753},[],[3755],{"type":47,"value":129},{"type":47,"value":3757},", not here. Review destructive ops in the plan output or in ",{"type":41,"tag":84,"props":3759,"children":3761},{"className":3760},[],[3762],{"type":47,"value":3551},{"type":47,"value":610},{"type":41,"tag":255,"props":3765,"children":3766},{},[3767],{"type":47,"value":3768},"before",{"type":47,"value":3770}," applying.",{"type":41,"tag":203,"props":3772,"children":3774},{"id":3773},"workflow-fill-a-placeholder",[3775],{"type":47,"value":3776},"Workflow — Fill a placeholder",{"type":41,"tag":54,"props":3778,"children":3779},{},[3780,3782,3787,3789,3794],{"type":47,"value":3781},"The concept: the planner can detect ",{"type":41,"tag":255,"props":3783,"children":3784},{},[3785],{"type":47,"value":3786},"that",{"type":47,"value":3788}," a data transform is needed but not ",{"type":41,"tag":255,"props":3790,"children":3791},{},[3792],{"type":47,"value":3793},"what",{"type":47,"value":3795}," it should do. It writes a typed scaffold and stops; you fill the transform, then self-emit.",{"type":41,"tag":3797,"props":3798,"children":3800},"h3",{"id":3799},"postgres",[3801],{"type":47,"value":169},{"type":41,"tag":54,"props":3803,"children":3804},{},[3805,3807,3811,3813,3819,3821,3825,3827,3832,3833,3838,3840,3845],{"type":47,"value":3806},"The planner can detect ",{"type":41,"tag":255,"props":3808,"children":3809},{},[3810],{"type":47,"value":3786},{"type":47,"value":3812}," a data transform is needed (e.g. backfilling a new ",{"type":41,"tag":84,"props":3814,"children":3816},{"className":3815},[],[3817],{"type":47,"value":3818},"NOT NULL",{"type":47,"value":3820}," column with no default) but not ",{"type":41,"tag":255,"props":3822,"children":3823},{},[3824],{"type":47,"value":3793},{"type":47,"value":3826}," it should do. You fill ",{"type":41,"tag":84,"props":3828,"children":3830},{"className":3829},[],[3831],{"type":47,"value":823},{"type":47,"value":131},{"type":41,"tag":84,"props":3834,"children":3836},{"className":3835},[],[3837],{"type":47,"value":831},{"type":47,"value":3839}," closures with real query plans built against ",{"type":41,"tag":84,"props":3841,"children":3843},{"className":3842},[],[3844],{"type":47,"value":839},{"type":47,"value":276},{"type":41,"tag":54,"props":3847,"children":3848},{},[3849],{"type":47,"value":3850},"The scaffold the planner emits looks like:",{"type":41,"tag":2002,"props":3852,"children":3855},{"className":3853,"code":3854,"language":14,"meta":2007,"style":2007},"language-typescript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","\u002F\u002F migrations\u002Fapp\u002F20260515T1200_add_user_name\u002Fmigration.ts\nimport endContract from '..\u002F..\u002Fsnapshots\u002F93f07d1b…c9e1e5a2\u002Fcontract.json' with { type: 'json' };\nimport { Migration, MigrationCLI, addColumn, placeholder } from '@prisma-next\u002Fpostgres\u002Fmigration';\n\nexport default class M extends Migration {\n  override get operations() {\n    return [\n      addColumn('public', 'user', {\n        name: 'name',\n        typeSql: 'text',\n        defaultSql: '',\n        nullable: true,\n      }),\n      this.dataTransform(endContract, 'backfill user.name', {\n        check: () => placeholder('backfill user.name:check'),\n        run:   () => placeholder('backfill user.name:run'),\n      }),\n    ];\n  }\n}\n\nMigrationCLI.run(import.meta.url, M);\n",[3856],{"type":41,"tag":84,"props":3857,"children":3858},{"__ignoreMap":2007},[3859,3867,3938,4009,4016,4054,4081,4095,4148,4179,4208,4230,4253,4270,4316,4367,4418,4434,4447,4456,4465,4473],{"type":41,"tag":2013,"props":3860,"children":3861},{"class":2015,"line":2016},[3862],{"type":41,"tag":2013,"props":3863,"children":3864},{"style":2534},[3865],{"type":47,"value":3866},"\u002F\u002F migrations\u002Fapp\u002F20260515T1200_add_user_name\u002Fmigration.ts\n",{"type":41,"tag":2013,"props":3868,"children":3869},{"class":2015,"line":2053},[3870,3876,3881,3885,3890,3895,3900,3905,3910,3916,3920,3924,3929,3933],{"type":41,"tag":2013,"props":3871,"children":3873},{"style":3872},"--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic",[3874],{"type":47,"value":3875},"import",{"type":41,"tag":2013,"props":3877,"children":3878},{"style":2047},[3879],{"type":47,"value":3880}," endContract ",{"type":41,"tag":2013,"props":3882,"children":3883},{"style":3872},[3884],{"type":47,"value":2797},{"type":41,"tag":2013,"props":3886,"children":3887},{"style":2075},[3888],{"type":47,"value":3889}," '",{"type":41,"tag":2013,"props":3891,"children":3892},{"style":2026},[3893],{"type":47,"value":3894},"..\u002F..\u002Fsnapshots\u002F93f07d1b…c9e1e5a2\u002Fcontract.json",{"type":41,"tag":2013,"props":3896,"children":3897},{"style":2075},[3898],{"type":47,"value":3899},"'",{"type":41,"tag":2013,"props":3901,"children":3902},{"style":3872},[3903],{"type":47,"value":3904}," with",{"type":41,"tag":2013,"props":3906,"children":3907},{"style":2075},[3908],{"type":47,"value":3909}," {",{"type":41,"tag":2013,"props":3911,"children":3913},{"style":3912},"--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178",[3914],{"type":47,"value":3915}," type",{"type":41,"tag":2013,"props":3917,"children":3918},{"style":2075},[3919],{"type":47,"value":3561},{"type":41,"tag":2013,"props":3921,"children":3922},{"style":2075},[3923],{"type":47,"value":3889},{"type":41,"tag":2013,"props":3925,"children":3926},{"style":2026},[3927],{"type":47,"value":3928},"json",{"type":41,"tag":2013,"props":3930,"children":3931},{"style":2075},[3932],{"type":47,"value":3899},{"type":41,"tag":2013,"props":3934,"children":3935},{"style":2075},[3936],{"type":47,"value":3937}," };\n",{"type":41,"tag":2013,"props":3939,"children":3940},{"class":2015,"line":2107},[3941,3945,3949,3954,3959,3964,3968,3973,3977,3982,3987,3992,3996,4000,4004],{"type":41,"tag":2013,"props":3942,"children":3943},{"style":3872},[3944],{"type":47,"value":3875},{"type":41,"tag":2013,"props":3946,"children":3947},{"style":2075},[3948],{"type":47,"value":3909},{"type":41,"tag":2013,"props":3950,"children":3951},{"style":2047},[3952],{"type":47,"value":3953}," Migration",{"type":41,"tag":2013,"props":3955,"children":3956},{"style":2075},[3957],{"type":47,"value":3958},",",{"type":41,"tag":2013,"props":3960,"children":3961},{"style":2047},[3962],{"type":47,"value":3963}," MigrationCLI",{"type":41,"tag":2013,"props":3965,"children":3966},{"style":2075},[3967],{"type":47,"value":3958},{"type":41,"tag":2013,"props":3969,"children":3970},{"style":2047},[3971],{"type":47,"value":3972}," addColumn",{"type":41,"tag":2013,"props":3974,"children":3975},{"style":2075},[3976],{"type":47,"value":3958},{"type":41,"tag":2013,"props":3978,"children":3979},{"style":2047},[3980],{"type":47,"value":3981}," placeholder",{"type":41,"tag":2013,"props":3983,"children":3984},{"style":2075},[3985],{"type":47,"value":3986}," }",{"type":41,"tag":2013,"props":3988,"children":3989},{"style":3872},[3990],{"type":47,"value":3991}," from",{"type":41,"tag":2013,"props":3993,"children":3994},{"style":2075},[3995],{"type":47,"value":3889},{"type":41,"tag":2013,"props":3997,"children":3998},{"style":2026},[3999],{"type":47,"value":706},{"type":41,"tag":2013,"props":4001,"children":4002},{"style":2075},[4003],{"type":47,"value":3899},{"type":41,"tag":2013,"props":4005,"children":4006},{"style":2075},[4007],{"type":47,"value":4008},";\n",{"type":41,"tag":2013,"props":4010,"children":4011},{"class":2015,"line":2159},[4012],{"type":41,"tag":2013,"props":4013,"children":4014},{"emptyLinePlaceholder":2581},[4015],{"type":47,"value":2584},{"type":41,"tag":2013,"props":4017,"children":4018},{"class":2015,"line":2184},[4019,4024,4029,4035,4040,4045,4049],{"type":41,"tag":2013,"props":4020,"children":4021},{"style":3872},[4022],{"type":47,"value":4023},"export",{"type":41,"tag":2013,"props":4025,"children":4026},{"style":3872},[4027],{"type":47,"value":4028}," default",{"type":41,"tag":2013,"props":4030,"children":4032},{"style":4031},"--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA",[4033],{"type":47,"value":4034}," class",{"type":41,"tag":2013,"props":4036,"children":4037},{"style":2020},[4038],{"type":47,"value":4039}," M",{"type":41,"tag":2013,"props":4041,"children":4042},{"style":4031},[4043],{"type":47,"value":4044}," extends",{"type":41,"tag":2013,"props":4046,"children":4047},{"style":2020},[4048],{"type":47,"value":3953},{"type":41,"tag":2013,"props":4050,"children":4051},{"style":2075},[4052],{"type":47,"value":4053}," {\n",{"type":41,"tag":2013,"props":4055,"children":4056},{"class":2015,"line":2640},[4057,4062,4067,4072,4077],{"type":41,"tag":2013,"props":4058,"children":4059},{"style":4031},[4060],{"type":47,"value":4061},"  override",{"type":41,"tag":2013,"props":4063,"children":4064},{"style":4031},[4065],{"type":47,"value":4066}," get",{"type":41,"tag":2013,"props":4068,"children":4069},{"style":3912},[4070],{"type":47,"value":4071}," operations",{"type":41,"tag":2013,"props":4073,"children":4074},{"style":2075},[4075],{"type":47,"value":4076},"()",{"type":41,"tag":2013,"props":4078,"children":4079},{"style":2075},[4080],{"type":47,"value":4053},{"type":41,"tag":2013,"props":4082,"children":4084},{"class":2015,"line":4083},7,[4085,4090],{"type":41,"tag":2013,"props":4086,"children":4087},{"style":3872},[4088],{"type":47,"value":4089},"    return",{"type":41,"tag":2013,"props":4091,"children":4092},{"style":3912},[4093],{"type":47,"value":4094}," [\n",{"type":41,"tag":2013,"props":4096,"children":4098},{"class":2015,"line":4097},8,[4099,4105,4110,4114,4119,4123,4127,4131,4136,4140,4144],{"type":41,"tag":2013,"props":4100,"children":4102},{"style":4101},"--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF",[4103],{"type":47,"value":4104},"      addColumn",{"type":41,"tag":2013,"props":4106,"children":4107},{"style":3912},[4108],{"type":47,"value":4109},"(",{"type":41,"tag":2013,"props":4111,"children":4112},{"style":2075},[4113],{"type":47,"value":3899},{"type":41,"tag":2013,"props":4115,"children":4116},{"style":2026},[4117],{"type":47,"value":4118},"public",{"type":41,"tag":2013,"props":4120,"children":4121},{"style":2075},[4122],{"type":47,"value":3899},{"type":41,"tag":2013,"props":4124,"children":4125},{"style":2075},[4126],{"type":47,"value":3958},{"type":41,"tag":2013,"props":4128,"children":4129},{"style":2075},[4130],{"type":47,"value":3889},{"type":41,"tag":2013,"props":4132,"children":4133},{"style":2026},[4134],{"type":47,"value":4135},"user",{"type":41,"tag":2013,"props":4137,"children":4138},{"style":2075},[4139],{"type":47,"value":3899},{"type":41,"tag":2013,"props":4141,"children":4142},{"style":2075},[4143],{"type":47,"value":3958},{"type":41,"tag":2013,"props":4145,"children":4146},{"style":2075},[4147],{"type":47,"value":4053},{"type":41,"tag":2013,"props":4149,"children":4151},{"class":2015,"line":4150},9,[4152,4157,4161,4165,4170,4174],{"type":41,"tag":2013,"props":4153,"children":4154},{"style":3912},[4155],{"type":47,"value":4156},"        name",{"type":41,"tag":2013,"props":4158,"children":4159},{"style":2075},[4160],{"type":47,"value":3561},{"type":41,"tag":2013,"props":4162,"children":4163},{"style":2075},[4164],{"type":47,"value":3889},{"type":41,"tag":2013,"props":4166,"children":4167},{"style":2026},[4168],{"type":47,"value":4169},"name",{"type":41,"tag":2013,"props":4171,"children":4172},{"style":2075},[4173],{"type":47,"value":3899},{"type":41,"tag":2013,"props":4175,"children":4176},{"style":2075},[4177],{"type":47,"value":4178},",\n",{"type":41,"tag":2013,"props":4180,"children":4182},{"class":2015,"line":4181},10,[4183,4188,4192,4196,4200,4204],{"type":41,"tag":2013,"props":4184,"children":4185},{"style":3912},[4186],{"type":47,"value":4187},"        typeSql",{"type":41,"tag":2013,"props":4189,"children":4190},{"style":2075},[4191],{"type":47,"value":3561},{"type":41,"tag":2013,"props":4193,"children":4194},{"style":2075},[4195],{"type":47,"value":3889},{"type":41,"tag":2013,"props":4197,"children":4198},{"style":2026},[4199],{"type":47,"value":47},{"type":41,"tag":2013,"props":4201,"children":4202},{"style":2075},[4203],{"type":47,"value":3899},{"type":41,"tag":2013,"props":4205,"children":4206},{"style":2075},[4207],{"type":47,"value":4178},{"type":41,"tag":2013,"props":4209,"children":4211},{"class":2015,"line":4210},11,[4212,4217,4221,4226],{"type":41,"tag":2013,"props":4213,"children":4214},{"style":3912},[4215],{"type":47,"value":4216},"        defaultSql",{"type":41,"tag":2013,"props":4218,"children":4219},{"style":2075},[4220],{"type":47,"value":3561},{"type":41,"tag":2013,"props":4222,"children":4223},{"style":2075},[4224],{"type":47,"value":4225}," ''",{"type":41,"tag":2013,"props":4227,"children":4228},{"style":2075},[4229],{"type":47,"value":4178},{"type":41,"tag":2013,"props":4231,"children":4233},{"class":2015,"line":4232},12,[4234,4239,4243,4249],{"type":41,"tag":2013,"props":4235,"children":4236},{"style":3912},[4237],{"type":47,"value":4238},"        nullable",{"type":41,"tag":2013,"props":4240,"children":4241},{"style":2075},[4242],{"type":47,"value":3561},{"type":41,"tag":2013,"props":4244,"children":4246},{"style":4245},"--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC",[4247],{"type":47,"value":4248}," true",{"type":41,"tag":2013,"props":4250,"children":4251},{"style":2075},[4252],{"type":47,"value":4178},{"type":41,"tag":2013,"props":4254,"children":4256},{"class":2015,"line":4255},13,[4257,4262,4266],{"type":41,"tag":2013,"props":4258,"children":4259},{"style":2075},[4260],{"type":47,"value":4261},"      }",{"type":41,"tag":2013,"props":4263,"children":4264},{"style":3912},[4265],{"type":47,"value":91},{"type":41,"tag":2013,"props":4267,"children":4268},{"style":2075},[4269],{"type":47,"value":4178},{"type":41,"tag":2013,"props":4271,"children":4273},{"class":2015,"line":4272},14,[4274,4279,4283,4287,4291,4295,4299,4304,4308,4312],{"type":41,"tag":2013,"props":4275,"children":4276},{"style":2075},[4277],{"type":47,"value":4278},"      this.",{"type":41,"tag":2013,"props":4280,"children":4281},{"style":4101},[4282],{"type":47,"value":1068},{"type":41,"tag":2013,"props":4284,"children":4285},{"style":3912},[4286],{"type":47,"value":4109},{"type":41,"tag":2013,"props":4288,"children":4289},{"style":2047},[4290],{"type":47,"value":839},{"type":41,"tag":2013,"props":4292,"children":4293},{"style":2075},[4294],{"type":47,"value":3958},{"type":41,"tag":2013,"props":4296,"children":4297},{"style":2075},[4298],{"type":47,"value":3889},{"type":41,"tag":2013,"props":4300,"children":4301},{"style":2026},[4302],{"type":47,"value":4303},"backfill user.name",{"type":41,"tag":2013,"props":4305,"children":4306},{"style":2075},[4307],{"type":47,"value":3899},{"type":41,"tag":2013,"props":4309,"children":4310},{"style":2075},[4311],{"type":47,"value":3958},{"type":41,"tag":2013,"props":4313,"children":4314},{"style":2075},[4315],{"type":47,"value":4053},{"type":41,"tag":2013,"props":4317,"children":4318},{"class":2015,"line":27},[4319,4324,4328,4333,4338,4342,4346,4350,4355,4359,4363],{"type":41,"tag":2013,"props":4320,"children":4321},{"style":4101},[4322],{"type":47,"value":4323},"        check",{"type":41,"tag":2013,"props":4325,"children":4326},{"style":2075},[4327],{"type":47,"value":3561},{"type":41,"tag":2013,"props":4329,"children":4330},{"style":2075},[4331],{"type":47,"value":4332}," ()",{"type":41,"tag":2013,"props":4334,"children":4335},{"style":4031},[4336],{"type":47,"value":4337}," =>",{"type":41,"tag":2013,"props":4339,"children":4340},{"style":4101},[4341],{"type":47,"value":3981},{"type":41,"tag":2013,"props":4343,"children":4344},{"style":3912},[4345],{"type":47,"value":4109},{"type":41,"tag":2013,"props":4347,"children":4348},{"style":2075},[4349],{"type":47,"value":3899},{"type":41,"tag":2013,"props":4351,"children":4352},{"style":2026},[4353],{"type":47,"value":4354},"backfill user.name:check",{"type":41,"tag":2013,"props":4356,"children":4357},{"style":2075},[4358],{"type":47,"value":3899},{"type":41,"tag":2013,"props":4360,"children":4361},{"style":3912},[4362],{"type":47,"value":91},{"type":41,"tag":2013,"props":4364,"children":4365},{"style":2075},[4366],{"type":47,"value":4178},{"type":41,"tag":2013,"props":4368,"children":4370},{"class":2015,"line":4369},16,[4371,4376,4380,4385,4389,4393,4397,4401,4406,4410,4414],{"type":41,"tag":2013,"props":4372,"children":4373},{"style":4101},[4374],{"type":47,"value":4375},"        run",{"type":41,"tag":2013,"props":4377,"children":4378},{"style":2075},[4379],{"type":47,"value":3561},{"type":41,"tag":2013,"props":4381,"children":4382},{"style":2075},[4383],{"type":47,"value":4384},"   ()",{"type":41,"tag":2013,"props":4386,"children":4387},{"style":4031},[4388],{"type":47,"value":4337},{"type":41,"tag":2013,"props":4390,"children":4391},{"style":4101},[4392],{"type":47,"value":3981},{"type":41,"tag":2013,"props":4394,"children":4395},{"style":3912},[4396],{"type":47,"value":4109},{"type":41,"tag":2013,"props":4398,"children":4399},{"style":2075},[4400],{"type":47,"value":3899},{"type":41,"tag":2013,"props":4402,"children":4403},{"style":2026},[4404],{"type":47,"value":4405},"backfill user.name:run",{"type":41,"tag":2013,"props":4407,"children":4408},{"style":2075},[4409],{"type":47,"value":3899},{"type":41,"tag":2013,"props":4411,"children":4412},{"style":3912},[4413],{"type":47,"value":91},{"type":41,"tag":2013,"props":4415,"children":4416},{"style":2075},[4417],{"type":47,"value":4178},{"type":41,"tag":2013,"props":4419,"children":4421},{"class":2015,"line":4420},17,[4422,4426,4430],{"type":41,"tag":2013,"props":4423,"children":4424},{"style":2075},[4425],{"type":47,"value":4261},{"type":41,"tag":2013,"props":4427,"children":4428},{"style":3912},[4429],{"type":47,"value":91},{"type":41,"tag":2013,"props":4431,"children":4432},{"style":2075},[4433],{"type":47,"value":4178},{"type":41,"tag":2013,"props":4435,"children":4437},{"class":2015,"line":4436},18,[4438,4443],{"type":41,"tag":2013,"props":4439,"children":4440},{"style":3912},[4441],{"type":47,"value":4442},"    ]",{"type":41,"tag":2013,"props":4444,"children":4445},{"style":2075},[4446],{"type":47,"value":4008},{"type":41,"tag":2013,"props":4448,"children":4450},{"class":2015,"line":4449},19,[4451],{"type":41,"tag":2013,"props":4452,"children":4453},{"style":2075},[4454],{"type":47,"value":4455},"  }\n",{"type":41,"tag":2013,"props":4457,"children":4459},{"class":2015,"line":4458},20,[4460],{"type":41,"tag":2013,"props":4461,"children":4462},{"style":2075},[4463],{"type":47,"value":4464},"}\n",{"type":41,"tag":2013,"props":4466,"children":4468},{"class":2015,"line":4467},21,[4469],{"type":41,"tag":2013,"props":4470,"children":4471},{"emptyLinePlaceholder":2581},[4472],{"type":47,"value":2584},{"type":41,"tag":2013,"props":4474,"children":4476},{"class":2015,"line":4475},22,[4477,4481,4485,4489,4493,4497,4501,4506,4510,4515,4519,4524],{"type":41,"tag":2013,"props":4478,"children":4479},{"style":2047},[4480],{"type":47,"value":1298},{"type":41,"tag":2013,"props":4482,"children":4483},{"style":2075},[4484],{"type":47,"value":276},{"type":41,"tag":2013,"props":4486,"children":4487},{"style":4101},[4488],{"type":47,"value":831},{"type":41,"tag":2013,"props":4490,"children":4491},{"style":2047},[4492],{"type":47,"value":4109},{"type":41,"tag":2013,"props":4494,"children":4495},{"style":3872},[4496],{"type":47,"value":3875},{"type":41,"tag":2013,"props":4498,"children":4499},{"style":2075},[4500],{"type":47,"value":276},{"type":41,"tag":2013,"props":4502,"children":4503},{"style":2047},[4504],{"type":47,"value":4505},"meta",{"type":41,"tag":2013,"props":4507,"children":4508},{"style":2075},[4509],{"type":47,"value":276},{"type":41,"tag":2013,"props":4511,"children":4512},{"style":2047},[4513],{"type":47,"value":4514},"url",{"type":41,"tag":2013,"props":4516,"children":4517},{"style":2075},[4518],{"type":47,"value":3958},{"type":41,"tag":2013,"props":4520,"children":4521},{"style":2047},[4522],{"type":47,"value":4523}," M)",{"type":41,"tag":2013,"props":4525,"children":4526},{"style":2075},[4527],{"type":47,"value":4008},{"type":41,"tag":54,"props":4529,"children":4530},{},[4531,4533,4538,4540,4545,4547,4552,4554,4559,4561,4567,4569,4575,4576,4582,4584,4589,4591,4596,4598,4603,4605,4611,4613,4619],{"type":47,"value":4532},"Replace both ",{"type":41,"tag":84,"props":4534,"children":4536},{"className":4535},[],[4537],{"type":47,"value":425},{"type":47,"value":4539}," calls with query-plan closures built from ",{"type":41,"tag":84,"props":4541,"children":4543},{"className":4542},[],[4544],{"type":47,"value":839},{"type":47,"value":4546},". The ",{"type":41,"tag":84,"props":4548,"children":4550},{"className":4549},[],[4551],{"type":47,"value":823},{"type":47,"value":4553}," closure must return a ",{"type":41,"tag":58,"props":4555,"children":4556},{},[4557],{"type":47,"value":4558},"rowset query whose presence of any row signals \"work remains\"",{"type":47,"value":4560}," — conventionally ",{"type":41,"tag":84,"props":4562,"children":4564},{"className":4563},[],[4565],{"type":47,"value":4566},"\u003Ctable>.select('id').where(\u003Cviolation predicate>).limit(1)",{"type":47,"value":4568},". Scalar\u002Faggregate shapes (",{"type":41,"tag":84,"props":4570,"children":4572},{"className":4571},[],[4573],{"type":47,"value":4574},"count(*)",{"type":47,"value":240},{"type":41,"tag":84,"props":4577,"children":4579},{"className":4578},[],[4580],{"type":47,"value":4581},"bool_and(...)",{"type":47,"value":4583},") silently break the contract: the runner wraps ",{"type":41,"tag":84,"props":4585,"children":4587},{"className":4586},[],[4588],{"type":47,"value":823},{"type":47,"value":4590}," twice (",{"type":41,"tag":84,"props":4592,"children":4594},{"className":4593},[],[4595],{"type":47,"value":854},{"type":47,"value":4597}," for precheck, ",{"type":41,"tag":84,"props":4599,"children":4601},{"className":4600},[],[4602],{"type":47,"value":862},{"type":47,"value":4604}," for postcheck), and a query that always returns one row makes ",{"type":41,"tag":84,"props":4606,"children":4608},{"className":4607},[],[4609],{"type":47,"value":4610},"EXISTS",{"type":47,"value":4612}," always true and ",{"type":41,"tag":84,"props":4614,"children":4616},{"className":4615},[],[4617],{"type":47,"value":4618},"NOT EXISTS",{"type":47,"value":4620}," always false.",{"type":41,"tag":54,"props":4622,"children":4623},{},[4624,4626,4631,4633,4638,4640,4645,4647,4653,4655,4660,4661,4666,4668,4674,4676,4681],{"type":47,"value":4625},"Build the query builder against ",{"type":41,"tag":84,"props":4627,"children":4629},{"className":4628},[],[4630],{"type":47,"value":839},{"type":47,"value":4632}," so the storage hashes line up — using a different contract reference raises ",{"type":41,"tag":84,"props":4634,"children":4636},{"className":4635},[],[4637],{"type":47,"value":1576},{"type":47,"value":4639},". The filled-in shape (the rendered scaffold above with ",{"type":41,"tag":84,"props":4641,"children":4643},{"className":4642},[],[4644],{"type":47,"value":425},{"type":47,"value":4646}," calls replaced; if you need an extra factory like ",{"type":41,"tag":84,"props":4648,"children":4650},{"className":4649},[],[4651],{"type":47,"value":4652},"setNotNull",{"type":47,"value":4654},", add it to the ",{"type":41,"tag":255,"props":4656,"children":4657},{},[4658],{"type":47,"value":4659},"existing",{"type":47,"value":610},{"type":41,"tag":84,"props":4662,"children":4664},{"className":4663},[],[4665],{"type":47,"value":706},{"type":47,"value":4667}," import line rather than authoring a second import). See ",{"type":41,"tag":84,"props":4669,"children":4671},{"className":4670},[],[4672],{"type":47,"value":4673},"prisma-next-queries",{"type":47,"value":4675}," for the surrounding ",{"type":41,"tag":84,"props":4677,"children":4679},{"className":4678},[],[4680],{"type":47,"value":1986},{"type":47,"value":4682}," setup:",{"type":41,"tag":2002,"props":4684,"children":4686},{"className":3853,"code":4685,"language":14,"meta":2007,"style":2007},"import endContract from '..\u002F..\u002Fsnapshots\u002F93f07d1b…c9e1e5a2\u002Fcontract.json' with { type: 'json' };\nimport { Migration, MigrationCLI, addColumn, setNotNull } from '@prisma-next\u002Fpostgres\u002Fmigration';\nimport { db } from '.\u002Fdb'; \u002F\u002F sql({ context: createExecutionContext({ contract: endContract, ... }) })\n\nexport default class M extends Migration {\n  override get operations() {\n    return [\n      addColumn('public', 'user', {\n        name: 'name',\n        typeSql: 'text',\n        defaultSql: '',\n        nullable: true,\n      }),\n      this.dataTransform(endContract, 'backfill user.name', {\n        check: () => db.users.select('id').where((f, fns) => fns.eq(f.name, null)).limit(1),\n        run:   () => db.users.update({ name: '' }).where((f, fns) => fns.eq(f.name, null)),\n      }),\n      setNotNull('public', 'user', 'name'),\n    ];\n  }\n}\n\nMigrationCLI.run(import.meta.url, M);\n",[4687],{"type":41,"tag":84,"props":4688,"children":4689},{"__ignoreMap":2007},[4690,4749,4813,4859,4866,4897,4920,4931,4978,5005,5032,5051,5070,5085,5128,5299,5449,5464,5528,5539,5546,5553,5560],{"type":41,"tag":2013,"props":4691,"children":4692},{"class":2015,"line":2016},[4693,4697,4701,4705,4709,4713,4717,4721,4725,4729,4733,4737,4741,4745],{"type":41,"tag":2013,"props":4694,"children":4695},{"style":3872},[4696],{"type":47,"value":3875},{"type":41,"tag":2013,"props":4698,"children":4699},{"style":2047},[4700],{"type":47,"value":3880},{"type":41,"tag":2013,"props":4702,"children":4703},{"style":3872},[4704],{"type":47,"value":2797},{"type":41,"tag":2013,"props":4706,"children":4707},{"style":2075},[4708],{"type":47,"value":3889},{"type":41,"tag":2013,"props":4710,"children":4711},{"style":2026},[4712],{"type":47,"value":3894},{"type":41,"tag":2013,"props":4714,"children":4715},{"style":2075},[4716],{"type":47,"value":3899},{"type":41,"tag":2013,"props":4718,"children":4719},{"style":3872},[4720],{"type":47,"value":3904},{"type":41,"tag":2013,"props":4722,"children":4723},{"style":2075},[4724],{"type":47,"value":3909},{"type":41,"tag":2013,"props":4726,"children":4727},{"style":3912},[4728],{"type":47,"value":3915},{"type":41,"tag":2013,"props":4730,"children":4731},{"style":2075},[4732],{"type":47,"value":3561},{"type":41,"tag":2013,"props":4734,"children":4735},{"style":2075},[4736],{"type":47,"value":3889},{"type":41,"tag":2013,"props":4738,"children":4739},{"style":2026},[4740],{"type":47,"value":3928},{"type":41,"tag":2013,"props":4742,"children":4743},{"style":2075},[4744],{"type":47,"value":3899},{"type":41,"tag":2013,"props":4746,"children":4747},{"style":2075},[4748],{"type":47,"value":3937},{"type":41,"tag":2013,"props":4750,"children":4751},{"class":2015,"line":2053},[4752,4756,4760,4764,4768,4772,4776,4780,4784,4789,4793,4797,4801,4805,4809],{"type":41,"tag":2013,"props":4753,"children":4754},{"style":3872},[4755],{"type":47,"value":3875},{"type":41,"tag":2013,"props":4757,"children":4758},{"style":2075},[4759],{"type":47,"value":3909},{"type":41,"tag":2013,"props":4761,"children":4762},{"style":2047},[4763],{"type":47,"value":3953},{"type":41,"tag":2013,"props":4765,"children":4766},{"style":2075},[4767],{"type":47,"value":3958},{"type":41,"tag":2013,"props":4769,"children":4770},{"style":2047},[4771],{"type":47,"value":3963},{"type":41,"tag":2013,"props":4773,"children":4774},{"style":2075},[4775],{"type":47,"value":3958},{"type":41,"tag":2013,"props":4777,"children":4778},{"style":2047},[4779],{"type":47,"value":3972},{"type":41,"tag":2013,"props":4781,"children":4782},{"style":2075},[4783],{"type":47,"value":3958},{"type":41,"tag":2013,"props":4785,"children":4786},{"style":2047},[4787],{"type":47,"value":4788}," setNotNull",{"type":41,"tag":2013,"props":4790,"children":4791},{"style":2075},[4792],{"type":47,"value":3986},{"type":41,"tag":2013,"props":4794,"children":4795},{"style":3872},[4796],{"type":47,"value":3991},{"type":41,"tag":2013,"props":4798,"children":4799},{"style":2075},[4800],{"type":47,"value":3889},{"type":41,"tag":2013,"props":4802,"children":4803},{"style":2026},[4804],{"type":47,"value":706},{"type":41,"tag":2013,"props":4806,"children":4807},{"style":2075},[4808],{"type":47,"value":3899},{"type":41,"tag":2013,"props":4810,"children":4811},{"style":2075},[4812],{"type":47,"value":4008},{"type":41,"tag":2013,"props":4814,"children":4815},{"class":2015,"line":2107},[4816,4820,4824,4828,4832,4836,4840,4845,4849,4854],{"type":41,"tag":2013,"props":4817,"children":4818},{"style":3872},[4819],{"type":47,"value":3875},{"type":41,"tag":2013,"props":4821,"children":4822},{"style":2075},[4823],{"type":47,"value":3909},{"type":41,"tag":2013,"props":4825,"children":4826},{"style":2047},[4827],{"type":47,"value":2034},{"type":41,"tag":2013,"props":4829,"children":4830},{"style":2075},[4831],{"type":47,"value":3986},{"type":41,"tag":2013,"props":4833,"children":4834},{"style":3872},[4835],{"type":47,"value":3991},{"type":41,"tag":2013,"props":4837,"children":4838},{"style":2075},[4839],{"type":47,"value":3889},{"type":41,"tag":2013,"props":4841,"children":4842},{"style":2026},[4843],{"type":47,"value":4844},".\u002Fdb",{"type":41,"tag":2013,"props":4846,"children":4847},{"style":2075},[4848],{"type":47,"value":3899},{"type":41,"tag":2013,"props":4850,"children":4851},{"style":2075},[4852],{"type":47,"value":4853},";",{"type":41,"tag":2013,"props":4855,"children":4856},{"style":2534},[4857],{"type":47,"value":4858}," \u002F\u002F sql({ context: createExecutionContext({ contract: endContract, ... }) })\n",{"type":41,"tag":2013,"props":4860,"children":4861},{"class":2015,"line":2159},[4862],{"type":41,"tag":2013,"props":4863,"children":4864},{"emptyLinePlaceholder":2581},[4865],{"type":47,"value":2584},{"type":41,"tag":2013,"props":4867,"children":4868},{"class":2015,"line":2184},[4869,4873,4877,4881,4885,4889,4893],{"type":41,"tag":2013,"props":4870,"children":4871},{"style":3872},[4872],{"type":47,"value":4023},{"type":41,"tag":2013,"props":4874,"children":4875},{"style":3872},[4876],{"type":47,"value":4028},{"type":41,"tag":2013,"props":4878,"children":4879},{"style":4031},[4880],{"type":47,"value":4034},{"type":41,"tag":2013,"props":4882,"children":4883},{"style":2020},[4884],{"type":47,"value":4039},{"type":41,"tag":2013,"props":4886,"children":4887},{"style":4031},[4888],{"type":47,"value":4044},{"type":41,"tag":2013,"props":4890,"children":4891},{"style":2020},[4892],{"type":47,"value":3953},{"type":41,"tag":2013,"props":4894,"children":4895},{"style":2075},[4896],{"type":47,"value":4053},{"type":41,"tag":2013,"props":4898,"children":4899},{"class":2015,"line":2640},[4900,4904,4908,4912,4916],{"type":41,"tag":2013,"props":4901,"children":4902},{"style":4031},[4903],{"type":47,"value":4061},{"type":41,"tag":2013,"props":4905,"children":4906},{"style":4031},[4907],{"type":47,"value":4066},{"type":41,"tag":2013,"props":4909,"children":4910},{"style":3912},[4911],{"type":47,"value":4071},{"type":41,"tag":2013,"props":4913,"children":4914},{"style":2075},[4915],{"type":47,"value":4076},{"type":41,"tag":2013,"props":4917,"children":4918},{"style":2075},[4919],{"type":47,"value":4053},{"type":41,"tag":2013,"props":4921,"children":4922},{"class":2015,"line":4083},[4923,4927],{"type":41,"tag":2013,"props":4924,"children":4925},{"style":3872},[4926],{"type":47,"value":4089},{"type":41,"tag":2013,"props":4928,"children":4929},{"style":3912},[4930],{"type":47,"value":4094},{"type":41,"tag":2013,"props":4932,"children":4933},{"class":2015,"line":4097},[4934,4938,4942,4946,4950,4954,4958,4962,4966,4970,4974],{"type":41,"tag":2013,"props":4935,"children":4936},{"style":4101},[4937],{"type":47,"value":4104},{"type":41,"tag":2013,"props":4939,"children":4940},{"style":3912},[4941],{"type":47,"value":4109},{"type":41,"tag":2013,"props":4943,"children":4944},{"style":2075},[4945],{"type":47,"value":3899},{"type":41,"tag":2013,"props":4947,"children":4948},{"style":2026},[4949],{"type":47,"value":4118},{"type":41,"tag":2013,"props":4951,"children":4952},{"style":2075},[4953],{"type":47,"value":3899},{"type":41,"tag":2013,"props":4955,"children":4956},{"style":2075},[4957],{"type":47,"value":3958},{"type":41,"tag":2013,"props":4959,"children":4960},{"style":2075},[4961],{"type":47,"value":3889},{"type":41,"tag":2013,"props":4963,"children":4964},{"style":2026},[4965],{"type":47,"value":4135},{"type":41,"tag":2013,"props":4967,"children":4968},{"style":2075},[4969],{"type":47,"value":3899},{"type":41,"tag":2013,"props":4971,"children":4972},{"style":2075},[4973],{"type":47,"value":3958},{"type":41,"tag":2013,"props":4975,"children":4976},{"style":2075},[4977],{"type":47,"value":4053},{"type":41,"tag":2013,"props":4979,"children":4980},{"class":2015,"line":4150},[4981,4985,4989,4993,4997,5001],{"type":41,"tag":2013,"props":4982,"children":4983},{"style":3912},[4984],{"type":47,"value":4156},{"type":41,"tag":2013,"props":4986,"children":4987},{"style":2075},[4988],{"type":47,"value":3561},{"type":41,"tag":2013,"props":4990,"children":4991},{"style":2075},[4992],{"type":47,"value":3889},{"type":41,"tag":2013,"props":4994,"children":4995},{"style":2026},[4996],{"type":47,"value":4169},{"type":41,"tag":2013,"props":4998,"children":4999},{"style":2075},[5000],{"type":47,"value":3899},{"type":41,"tag":2013,"props":5002,"children":5003},{"style":2075},[5004],{"type":47,"value":4178},{"type":41,"tag":2013,"props":5006,"children":5007},{"class":2015,"line":4181},[5008,5012,5016,5020,5024,5028],{"type":41,"tag":2013,"props":5009,"children":5010},{"style":3912},[5011],{"type":47,"value":4187},{"type":41,"tag":2013,"props":5013,"children":5014},{"style":2075},[5015],{"type":47,"value":3561},{"type":41,"tag":2013,"props":5017,"children":5018},{"style":2075},[5019],{"type":47,"value":3889},{"type":41,"tag":2013,"props":5021,"children":5022},{"style":2026},[5023],{"type":47,"value":47},{"type":41,"tag":2013,"props":5025,"children":5026},{"style":2075},[5027],{"type":47,"value":3899},{"type":41,"tag":2013,"props":5029,"children":5030},{"style":2075},[5031],{"type":47,"value":4178},{"type":41,"tag":2013,"props":5033,"children":5034},{"class":2015,"line":4210},[5035,5039,5043,5047],{"type":41,"tag":2013,"props":5036,"children":5037},{"style":3912},[5038],{"type":47,"value":4216},{"type":41,"tag":2013,"props":5040,"children":5041},{"style":2075},[5042],{"type":47,"value":3561},{"type":41,"tag":2013,"props":5044,"children":5045},{"style":2075},[5046],{"type":47,"value":4225},{"type":41,"tag":2013,"props":5048,"children":5049},{"style":2075},[5050],{"type":47,"value":4178},{"type":41,"tag":2013,"props":5052,"children":5053},{"class":2015,"line":4232},[5054,5058,5062,5066],{"type":41,"tag":2013,"props":5055,"children":5056},{"style":3912},[5057],{"type":47,"value":4238},{"type":41,"tag":2013,"props":5059,"children":5060},{"style":2075},[5061],{"type":47,"value":3561},{"type":41,"tag":2013,"props":5063,"children":5064},{"style":4245},[5065],{"type":47,"value":4248},{"type":41,"tag":2013,"props":5067,"children":5068},{"style":2075},[5069],{"type":47,"value":4178},{"type":41,"tag":2013,"props":5071,"children":5072},{"class":2015,"line":4255},[5073,5077,5081],{"type":41,"tag":2013,"props":5074,"children":5075},{"style":2075},[5076],{"type":47,"value":4261},{"type":41,"tag":2013,"props":5078,"children":5079},{"style":3912},[5080],{"type":47,"value":91},{"type":41,"tag":2013,"props":5082,"children":5083},{"style":2075},[5084],{"type":47,"value":4178},{"type":41,"tag":2013,"props":5086,"children":5087},{"class":2015,"line":4272},[5088,5092,5096,5100,5104,5108,5112,5116,5120,5124],{"type":41,"tag":2013,"props":5089,"children":5090},{"style":2075},[5091],{"type":47,"value":4278},{"type":41,"tag":2013,"props":5093,"children":5094},{"style":4101},[5095],{"type":47,"value":1068},{"type":41,"tag":2013,"props":5097,"children":5098},{"style":3912},[5099],{"type":47,"value":4109},{"type":41,"tag":2013,"props":5101,"children":5102},{"style":2047},[5103],{"type":47,"value":839},{"type":41,"tag":2013,"props":5105,"children":5106},{"style":2075},[5107],{"type":47,"value":3958},{"type":41,"tag":2013,"props":5109,"children":5110},{"style":2075},[5111],{"type":47,"value":3889},{"type":41,"tag":2013,"props":5113,"children":5114},{"style":2026},[5115],{"type":47,"value":4303},{"type":41,"tag":2013,"props":5117,"children":5118},{"style":2075},[5119],{"type":47,"value":3899},{"type":41,"tag":2013,"props":5121,"children":5122},{"style":2075},[5123],{"type":47,"value":3958},{"type":41,"tag":2013,"props":5125,"children":5126},{"style":2075},[5127],{"type":47,"value":4053},{"type":41,"tag":2013,"props":5129,"children":5130},{"class":2015,"line":27},[5131,5135,5139,5143,5147,5151,5155,5160,5164,5169,5173,5177,5182,5186,5190,5194,5199,5203,5207,5212,5216,5221,5225,5229,5233,5237,5242,5246,5250,5254,5258,5262,5267,5272,5276,5281,5285,5291,5295],{"type":41,"tag":2013,"props":5132,"children":5133},{"style":4101},[5134],{"type":47,"value":4323},{"type":41,"tag":2013,"props":5136,"children":5137},{"style":2075},[5138],{"type":47,"value":3561},{"type":41,"tag":2013,"props":5140,"children":5141},{"style":2075},[5142],{"type":47,"value":4332},{"type":41,"tag":2013,"props":5144,"children":5145},{"style":4031},[5146],{"type":47,"value":4337},{"type":41,"tag":2013,"props":5148,"children":5149},{"style":2047},[5150],{"type":47,"value":2034},{"type":41,"tag":2013,"props":5152,"children":5153},{"style":2075},[5154],{"type":47,"value":276},{"type":41,"tag":2013,"props":5156,"children":5157},{"style":2047},[5158],{"type":47,"value":5159},"users",{"type":41,"tag":2013,"props":5161,"children":5162},{"style":2075},[5163],{"type":47,"value":276},{"type":41,"tag":2013,"props":5165,"children":5166},{"style":4101},[5167],{"type":47,"value":5168},"select",{"type":41,"tag":2013,"props":5170,"children":5171},{"style":3912},[5172],{"type":47,"value":4109},{"type":41,"tag":2013,"props":5174,"children":5175},{"style":2075},[5176],{"type":47,"value":3899},{"type":41,"tag":2013,"props":5178,"children":5179},{"style":2026},[5180],{"type":47,"value":5181},"id",{"type":41,"tag":2013,"props":5183,"children":5184},{"style":2075},[5185],{"type":47,"value":3899},{"type":41,"tag":2013,"props":5187,"children":5188},{"style":3912},[5189],{"type":47,"value":91},{"type":41,"tag":2013,"props":5191,"children":5192},{"style":2075},[5193],{"type":47,"value":276},{"type":41,"tag":2013,"props":5195,"children":5196},{"style":4101},[5197],{"type":47,"value":5198},"where",{"type":41,"tag":2013,"props":5200,"children":5201},{"style":3912},[5202],{"type":47,"value":4109},{"type":41,"tag":2013,"props":5204,"children":5205},{"style":2075},[5206],{"type":47,"value":4109},{"type":41,"tag":2013,"props":5208,"children":5210},{"style":5209},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic",[5211],{"type":47,"value":3656},{"type":41,"tag":2013,"props":5213,"children":5214},{"style":2075},[5215],{"type":47,"value":3958},{"type":41,"tag":2013,"props":5217,"children":5218},{"style":5209},[5219],{"type":47,"value":5220}," fns",{"type":41,"tag":2013,"props":5222,"children":5223},{"style":2075},[5224],{"type":47,"value":91},{"type":41,"tag":2013,"props":5226,"children":5227},{"style":4031},[5228],{"type":47,"value":4337},{"type":41,"tag":2013,"props":5230,"children":5231},{"style":2047},[5232],{"type":47,"value":5220},{"type":41,"tag":2013,"props":5234,"children":5235},{"style":2075},[5236],{"type":47,"value":276},{"type":41,"tag":2013,"props":5238,"children":5239},{"style":4101},[5240],{"type":47,"value":5241},"eq",{"type":41,"tag":2013,"props":5243,"children":5244},{"style":3912},[5245],{"type":47,"value":4109},{"type":41,"tag":2013,"props":5247,"children":5248},{"style":2047},[5249],{"type":47,"value":3656},{"type":41,"tag":2013,"props":5251,"children":5252},{"style":2075},[5253],{"type":47,"value":276},{"type":41,"tag":2013,"props":5255,"children":5256},{"style":2047},[5257],{"type":47,"value":4169},{"type":41,"tag":2013,"props":5259,"children":5260},{"style":2075},[5261],{"type":47,"value":3958},{"type":41,"tag":2013,"props":5263,"children":5264},{"style":2075},[5265],{"type":47,"value":5266}," null",{"type":41,"tag":2013,"props":5268,"children":5269},{"style":3912},[5270],{"type":47,"value":5271},"))",{"type":41,"tag":2013,"props":5273,"children":5274},{"style":2075},[5275],{"type":47,"value":276},{"type":41,"tag":2013,"props":5277,"children":5278},{"style":4101},[5279],{"type":47,"value":5280},"limit",{"type":41,"tag":2013,"props":5282,"children":5283},{"style":3912},[5284],{"type":47,"value":4109},{"type":41,"tag":2013,"props":5286,"children":5288},{"style":5287},"--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C",[5289],{"type":47,"value":5290},"1",{"type":41,"tag":2013,"props":5292,"children":5293},{"style":3912},[5294],{"type":47,"value":91},{"type":41,"tag":2013,"props":5296,"children":5297},{"style":2075},[5298],{"type":47,"value":4178},{"type":41,"tag":2013,"props":5300,"children":5301},{"class":2015,"line":4369},[5302,5306,5310,5314,5318,5322,5326,5330,5334,5339,5343,5348,5353,5357,5361,5365,5369,5373,5377,5381,5385,5389,5393,5397,5401,5405,5409,5413,5417,5421,5425,5429,5433,5437,5441,5445],{"type":41,"tag":2013,"props":5303,"children":5304},{"style":4101},[5305],{"type":47,"value":4375},{"type":41,"tag":2013,"props":5307,"children":5308},{"style":2075},[5309],{"type":47,"value":3561},{"type":41,"tag":2013,"props":5311,"children":5312},{"style":2075},[5313],{"type":47,"value":4384},{"type":41,"tag":2013,"props":5315,"children":5316},{"style":4031},[5317],{"type":47,"value":4337},{"type":41,"tag":2013,"props":5319,"children":5320},{"style":2047},[5321],{"type":47,"value":2034},{"type":41,"tag":2013,"props":5323,"children":5324},{"style":2075},[5325],{"type":47,"value":276},{"type":41,"tag":2013,"props":5327,"children":5328},{"style":2047},[5329],{"type":47,"value":5159},{"type":41,"tag":2013,"props":5331,"children":5332},{"style":2075},[5333],{"type":47,"value":276},{"type":41,"tag":2013,"props":5335,"children":5336},{"style":4101},[5337],{"type":47,"value":5338},"update",{"type":41,"tag":2013,"props":5340,"children":5341},{"style":3912},[5342],{"type":47,"value":4109},{"type":41,"tag":2013,"props":5344,"children":5345},{"style":2075},[5346],{"type":47,"value":5347},"{",{"type":41,"tag":2013,"props":5349,"children":5350},{"style":3912},[5351],{"type":47,"value":5352}," name",{"type":41,"tag":2013,"props":5354,"children":5355},{"style":2075},[5356],{"type":47,"value":3561},{"type":41,"tag":2013,"props":5358,"children":5359},{"style":2075},[5360],{"type":47,"value":4225},{"type":41,"tag":2013,"props":5362,"children":5363},{"style":2075},[5364],{"type":47,"value":3986},{"type":41,"tag":2013,"props":5366,"children":5367},{"style":3912},[5368],{"type":47,"value":91},{"type":41,"tag":2013,"props":5370,"children":5371},{"style":2075},[5372],{"type":47,"value":276},{"type":41,"tag":2013,"props":5374,"children":5375},{"style":4101},[5376],{"type":47,"value":5198},{"type":41,"tag":2013,"props":5378,"children":5379},{"style":3912},[5380],{"type":47,"value":4109},{"type":41,"tag":2013,"props":5382,"children":5383},{"style":2075},[5384],{"type":47,"value":4109},{"type":41,"tag":2013,"props":5386,"children":5387},{"style":5209},[5388],{"type":47,"value":3656},{"type":41,"tag":2013,"props":5390,"children":5391},{"style":2075},[5392],{"type":47,"value":3958},{"type":41,"tag":2013,"props":5394,"children":5395},{"style":5209},[5396],{"type":47,"value":5220},{"type":41,"tag":2013,"props":5398,"children":5399},{"style":2075},[5400],{"type":47,"value":91},{"type":41,"tag":2013,"props":5402,"children":5403},{"style":4031},[5404],{"type":47,"value":4337},{"type":41,"tag":2013,"props":5406,"children":5407},{"style":2047},[5408],{"type":47,"value":5220},{"type":41,"tag":2013,"props":5410,"children":5411},{"style":2075},[5412],{"type":47,"value":276},{"type":41,"tag":2013,"props":5414,"children":5415},{"style":4101},[5416],{"type":47,"value":5241},{"type":41,"tag":2013,"props":5418,"children":5419},{"style":3912},[5420],{"type":47,"value":4109},{"type":41,"tag":2013,"props":5422,"children":5423},{"style":2047},[5424],{"type":47,"value":3656},{"type":41,"tag":2013,"props":5426,"children":5427},{"style":2075},[5428],{"type":47,"value":276},{"type":41,"tag":2013,"props":5430,"children":5431},{"style":2047},[5432],{"type":47,"value":4169},{"type":41,"tag":2013,"props":5434,"children":5435},{"style":2075},[5436],{"type":47,"value":3958},{"type":41,"tag":2013,"props":5438,"children":5439},{"style":2075},[5440],{"type":47,"value":5266},{"type":41,"tag":2013,"props":5442,"children":5443},{"style":3912},[5444],{"type":47,"value":5271},{"type":41,"tag":2013,"props":5446,"children":5447},{"style":2075},[5448],{"type":47,"value":4178},{"type":41,"tag":2013,"props":5450,"children":5451},{"class":2015,"line":4420},[5452,5456,5460],{"type":41,"tag":2013,"props":5453,"children":5454},{"style":2075},[5455],{"type":47,"value":4261},{"type":41,"tag":2013,"props":5457,"children":5458},{"style":3912},[5459],{"type":47,"value":91},{"type":41,"tag":2013,"props":5461,"children":5462},{"style":2075},[5463],{"type":47,"value":4178},{"type":41,"tag":2013,"props":5465,"children":5466},{"class":2015,"line":4436},[5467,5472,5476,5480,5484,5488,5492,5496,5500,5504,5508,5512,5516,5520,5524],{"type":41,"tag":2013,"props":5468,"children":5469},{"style":4101},[5470],{"type":47,"value":5471},"      setNotNull",{"type":41,"tag":2013,"props":5473,"children":5474},{"style":3912},[5475],{"type":47,"value":4109},{"type":41,"tag":2013,"props":5477,"children":5478},{"style":2075},[5479],{"type":47,"value":3899},{"type":41,"tag":2013,"props":5481,"children":5482},{"style":2026},[5483],{"type":47,"value":4118},{"type":41,"tag":2013,"props":5485,"children":5486},{"style":2075},[5487],{"type":47,"value":3899},{"type":41,"tag":2013,"props":5489,"children":5490},{"style":2075},[5491],{"type":47,"value":3958},{"type":41,"tag":2013,"props":5493,"children":5494},{"style":2075},[5495],{"type":47,"value":3889},{"type":41,"tag":2013,"props":5497,"children":5498},{"style":2026},[5499],{"type":47,"value":4135},{"type":41,"tag":2013,"props":5501,"children":5502},{"style":2075},[5503],{"type":47,"value":3899},{"type":41,"tag":2013,"props":5505,"children":5506},{"style":2075},[5507],{"type":47,"value":3958},{"type":41,"tag":2013,"props":5509,"children":5510},{"style":2075},[5511],{"type":47,"value":3889},{"type":41,"tag":2013,"props":5513,"children":5514},{"style":2026},[5515],{"type":47,"value":4169},{"type":41,"tag":2013,"props":5517,"children":5518},{"style":2075},[5519],{"type":47,"value":3899},{"type":41,"tag":2013,"props":5521,"children":5522},{"style":3912},[5523],{"type":47,"value":91},{"type":41,"tag":2013,"props":5525,"children":5526},{"style":2075},[5527],{"type":47,"value":4178},{"type":41,"tag":2013,"props":5529,"children":5530},{"class":2015,"line":4449},[5531,5535],{"type":41,"tag":2013,"props":5532,"children":5533},{"style":3912},[5534],{"type":47,"value":4442},{"type":41,"tag":2013,"props":5536,"children":5537},{"style":2075},[5538],{"type":47,"value":4008},{"type":41,"tag":2013,"props":5540,"children":5541},{"class":2015,"line":4458},[5542],{"type":41,"tag":2013,"props":5543,"children":5544},{"style":2075},[5545],{"type":47,"value":4455},{"type":41,"tag":2013,"props":5547,"children":5548},{"class":2015,"line":4467},[5549],{"type":41,"tag":2013,"props":5550,"children":5551},{"style":2075},[5552],{"type":47,"value":4464},{"type":41,"tag":2013,"props":5554,"children":5555},{"class":2015,"line":4475},[5556],{"type":41,"tag":2013,"props":5557,"children":5558},{"emptyLinePlaceholder":2581},[5559],{"type":47,"value":2584},{"type":41,"tag":2013,"props":5561,"children":5563},{"class":2015,"line":5562},23,[5564,5568,5572,5576,5580,5584,5588,5592,5596,5600,5604,5608],{"type":41,"tag":2013,"props":5565,"children":5566},{"style":2047},[5567],{"type":47,"value":1298},{"type":41,"tag":2013,"props":5569,"children":5570},{"style":2075},[5571],{"type":47,"value":276},{"type":41,"tag":2013,"props":5573,"children":5574},{"style":4101},[5575],{"type":47,"value":831},{"type":41,"tag":2013,"props":5577,"children":5578},{"style":2047},[5579],{"type":47,"value":4109},{"type":41,"tag":2013,"props":5581,"children":5582},{"style":3872},[5583],{"type":47,"value":3875},{"type":41,"tag":2013,"props":5585,"children":5586},{"style":2075},[5587],{"type":47,"value":276},{"type":41,"tag":2013,"props":5589,"children":5590},{"style":2047},[5591],{"type":47,"value":4505},{"type":41,"tag":2013,"props":5593,"children":5594},{"style":2075},[5595],{"type":47,"value":276},{"type":41,"tag":2013,"props":5597,"children":5598},{"style":2047},[5599],{"type":47,"value":4514},{"type":41,"tag":2013,"props":5601,"children":5602},{"style":2075},[5603],{"type":47,"value":3958},{"type":41,"tag":2013,"props":5605,"children":5606},{"style":2047},[5607],{"type":47,"value":4523},{"type":41,"tag":2013,"props":5609,"children":5610},{"style":2075},[5611],{"type":47,"value":4008},{"type":41,"tag":54,"props":5613,"children":5614},{},[5615],{"type":47,"value":5616},"Self-emit:",{"type":41,"tag":2002,"props":5618,"children":5620},{"className":2004,"code":5619,"language":2006,"meta":2007,"style":2007},"node migrations\u002Fapp\u002F20260515T1200_add_user_name\u002Fmigration.ts\n",[5621],{"type":41,"tag":84,"props":5622,"children":5623},{"__ignoreMap":2007},[5624],{"type":41,"tag":2013,"props":5625,"children":5626},{"class":2015,"line":2016},[5627,5632],{"type":41,"tag":2013,"props":5628,"children":5629},{"style":2020},[5630],{"type":47,"value":5631},"node",{"type":41,"tag":2013,"props":5633,"children":5634},{"style":2026},[5635],{"type":47,"value":5636}," migrations\u002Fapp\u002F20260515T1200_add_user_name\u002Fmigration.ts\n",{"type":41,"tag":54,"props":5638,"children":5639},{},[5640,5642,5647,5649,5654,5656,5661,5663,5668],{"type":47,"value":5641},"Self-emit regenerates ",{"type":41,"tag":84,"props":5643,"children":5645},{"className":5644},[],[5646],{"type":47,"value":539},{"type":47,"value":5648}," and recomputes ",{"type":41,"tag":84,"props":5650,"children":5652},{"className":5651},[],[5653],{"type":47,"value":528},{"type":47,"value":5655}," in ",{"type":41,"tag":84,"props":5657,"children":5659},{"className":5658},[],[5660],{"type":47,"value":520},{"type":47,"value":5662},". The next ",{"type":41,"tag":84,"props":5664,"children":5666},{"className":5665},[],[5667],{"type":47,"value":145},{"type":47,"value":5669}," will see a consistent package.",{"type":41,"tag":3797,"props":5671,"children":5673},{"id":5672},"mongo",[5674],{"type":47,"value":175},{"type":41,"tag":54,"props":5676,"children":5677},{},[5678,5680,5685,5687,5693,5695,5701,5702,5707,5709,5715,5716,5722,5724,5730,5732,5737,5739,5744,5746,5752,5754,5759,5760,5765,5767,5772],{"type":47,"value":5679},"Mongo ",{"type":41,"tag":84,"props":5681,"children":5683},{"className":5682},[],[5684],{"type":47,"value":1068},{"type":47,"value":5686}," operations take ",{"type":41,"tag":84,"props":5688,"children":5690},{"className":5689},[],[5691],{"type":47,"value":5692},"{ check, run }",{"type":47,"value":5694}," objects whose ",{"type":41,"tag":84,"props":5696,"children":5698},{"className":5697},[],[5699],{"type":47,"value":5700},"source",{"type":47,"value":482},{"type":41,"tag":84,"props":5703,"children":5705},{"className":5704},[],[5706],{"type":47,"value":831},{"type":47,"value":5708}," return Mongo query-plan shapes (often ",{"type":41,"tag":84,"props":5710,"children":5712},{"className":5711},[],[5713],{"type":47,"value":5714},"RawAggregateCommand",{"type":47,"value":482},{"type":41,"tag":84,"props":5717,"children":5719},{"className":5718},[],[5720],{"type":47,"value":5721},"RawUpdateManyCommand",{"type":47,"value":5723}," from ",{"type":41,"tag":84,"props":5725,"children":5727},{"className":5726},[],[5728],{"type":47,"value":5729},"@prisma-next\u002Fmongo-query-ast\u002Fexecution",{"type":47,"value":5731},"). The planner may leave ",{"type":41,"tag":84,"props":5733,"children":5735},{"className":5734},[],[5736],{"type":47,"value":425},{"type":47,"value":5738}," inside those sources until you fill them. Every rendered ",{"type":41,"tag":84,"props":5740,"children":5742},{"className":5741},[],[5743],{"type":47,"value":115},{"type":47,"value":5745}," includes ",{"type":41,"tag":84,"props":5747,"children":5749},{"className":5748},[],[5750],{"type":47,"value":5751},"describe()",{"type":47,"value":5753}," bookends (",{"type":41,"tag":84,"props":5755,"children":5757},{"className":5756},[],[5758],{"type":47,"value":2797},{"type":47,"value":482},{"type":41,"tag":84,"props":5761,"children":5763},{"className":5762},[],[5764],{"type":47,"value":1025},{"type":47,"value":5766}," contract hashes) — the Postgres examples above omit them for brevity. Import factories from ",{"type":41,"tag":84,"props":5768,"children":5770},{"className":5769},[],[5771],{"type":47,"value":1277},{"type":47,"value":3561},{"type":41,"tag":2002,"props":5774,"children":5776},{"className":3853,"code":5775,"language":14,"meta":2007,"style":2007},"import { MigrationCLI } from '@prisma-next\u002Fcli\u002Fmigration-cli';\nimport { Migration } from '@prisma-next\u002Ffamily-mongo\u002Fmigration';\nimport { createIndex, dataTransform } from '@prisma-next\u002Ftarget-mongo\u002Fmigration';\nimport { RawAggregateCommand, RawUpdateManyCommand } from '@prisma-next\u002Fmongo-query-ast\u002Fexecution';\n\nclass M extends Migration {\n  override describe() {\n    return { from: '\u003Chex>', to: '\u003Chex>', labels: ['normalize-names'] };\n  }\n\n  override get operations() {\n    return [\n      createIndex('users', [{ field: 'name', direction: 1 }]),\n      dataTransform('lowercase-user-name', {\n        check: {\n          source: () => ({\n            collection: 'users',\n            command: new RawAggregateCommand('users', [\n              { $match: { name: { $regex: '[A-Z]' } } },\n              { $limit: 1 },\n            ]),\n            meta: { target: 'mongo', storageHash: '…', lane: 'mongo-pipeline', paramDescriptors: [] },\n          }),\n        },\n        run: () => ({\n          collection: 'users',\n          command: new RawUpdateManyCommand(\n            'users',\n            { name: { $exists: true } },\n            [{ $set: { name: { $toLower: '$name' } } }],\n          ),\n          meta: { target: 'mongo', storageHash: '…', lane: 'mongo-raw', paramDescriptors: [] },\n        }),\n      }),\n    ];\n  }\n}\n\nexport default M;\nMigrationCLI.run(import.meta.url, M);\n",[5777],{"type":41,"tag":84,"props":5778,"children":5779},{"__ignoreMap":2007},[5780,5819,5858,5907,5956,5963,5987,6007,6104,6111,6118,6141,6152,6240,6273,6288,6317,6345,6390,6458,6482,6494,6606,6622,6631,6659,6688,6714,6735,6777,6858,6871,6977,6994,7010,7022,7030,7038,7046,7066],{"type":41,"tag":2013,"props":5781,"children":5782},{"class":2015,"line":2016},[5783,5787,5791,5795,5799,5803,5807,5811,5815],{"type":41,"tag":2013,"props":5784,"children":5785},{"style":3872},[5786],{"type":47,"value":3875},{"type":41,"tag":2013,"props":5788,"children":5789},{"style":2075},[5790],{"type":47,"value":3909},{"type":41,"tag":2013,"props":5792,"children":5793},{"style":2047},[5794],{"type":47,"value":3963},{"type":41,"tag":2013,"props":5796,"children":5797},{"style":2075},[5798],{"type":47,"value":3986},{"type":41,"tag":2013,"props":5800,"children":5801},{"style":3872},[5802],{"type":47,"value":3991},{"type":41,"tag":2013,"props":5804,"children":5805},{"style":2075},[5806],{"type":47,"value":3889},{"type":41,"tag":2013,"props":5808,"children":5809},{"style":2026},[5810],{"type":47,"value":1306},{"type":41,"tag":2013,"props":5812,"children":5813},{"style":2075},[5814],{"type":47,"value":3899},{"type":41,"tag":2013,"props":5816,"children":5817},{"style":2075},[5818],{"type":47,"value":4008},{"type":41,"tag":2013,"props":5820,"children":5821},{"class":2015,"line":2053},[5822,5826,5830,5834,5838,5842,5846,5850,5854],{"type":41,"tag":2013,"props":5823,"children":5824},{"style":3872},[5825],{"type":47,"value":3875},{"type":41,"tag":2013,"props":5827,"children":5828},{"style":2075},[5829],{"type":47,"value":3909},{"type":41,"tag":2013,"props":5831,"children":5832},{"style":2047},[5833],{"type":47,"value":3953},{"type":41,"tag":2013,"props":5835,"children":5836},{"style":2075},[5837],{"type":47,"value":3986},{"type":41,"tag":2013,"props":5839,"children":5840},{"style":3872},[5841],{"type":47,"value":3991},{"type":41,"tag":2013,"props":5843,"children":5844},{"style":2075},[5845],{"type":47,"value":3889},{"type":41,"tag":2013,"props":5847,"children":5848},{"style":2026},[5849],{"type":47,"value":698},{"type":41,"tag":2013,"props":5851,"children":5852},{"style":2075},[5853],{"type":47,"value":3899},{"type":41,"tag":2013,"props":5855,"children":5856},{"style":2075},[5857],{"type":47,"value":4008},{"type":41,"tag":2013,"props":5859,"children":5860},{"class":2015,"line":2107},[5861,5865,5869,5874,5878,5883,5887,5891,5895,5899,5903],{"type":41,"tag":2013,"props":5862,"children":5863},{"style":3872},[5864],{"type":47,"value":3875},{"type":41,"tag":2013,"props":5866,"children":5867},{"style":2075},[5868],{"type":47,"value":3909},{"type":41,"tag":2013,"props":5870,"children":5871},{"style":2047},[5872],{"type":47,"value":5873}," createIndex",{"type":41,"tag":2013,"props":5875,"children":5876},{"style":2075},[5877],{"type":47,"value":3958},{"type":41,"tag":2013,"props":5879,"children":5880},{"style":2047},[5881],{"type":47,"value":5882}," dataTransform",{"type":41,"tag":2013,"props":5884,"children":5885},{"style":2075},[5886],{"type":47,"value":3986},{"type":41,"tag":2013,"props":5888,"children":5889},{"style":3872},[5890],{"type":47,"value":3991},{"type":41,"tag":2013,"props":5892,"children":5893},{"style":2075},[5894],{"type":47,"value":3889},{"type":41,"tag":2013,"props":5896,"children":5897},{"style":2026},[5898],{"type":47,"value":1277},{"type":41,"tag":2013,"props":5900,"children":5901},{"style":2075},[5902],{"type":47,"value":3899},{"type":41,"tag":2013,"props":5904,"children":5905},{"style":2075},[5906],{"type":47,"value":4008},{"type":41,"tag":2013,"props":5908,"children":5909},{"class":2015,"line":2159},[5910,5914,5918,5923,5927,5932,5936,5940,5944,5948,5952],{"type":41,"tag":2013,"props":5911,"children":5912},{"style":3872},[5913],{"type":47,"value":3875},{"type":41,"tag":2013,"props":5915,"children":5916},{"style":2075},[5917],{"type":47,"value":3909},{"type":41,"tag":2013,"props":5919,"children":5920},{"style":2047},[5921],{"type":47,"value":5922}," RawAggregateCommand",{"type":41,"tag":2013,"props":5924,"children":5925},{"style":2075},[5926],{"type":47,"value":3958},{"type":41,"tag":2013,"props":5928,"children":5929},{"style":2047},[5930],{"type":47,"value":5931}," RawUpdateManyCommand",{"type":41,"tag":2013,"props":5933,"children":5934},{"style":2075},[5935],{"type":47,"value":3986},{"type":41,"tag":2013,"props":5937,"children":5938},{"style":3872},[5939],{"type":47,"value":3991},{"type":41,"tag":2013,"props":5941,"children":5942},{"style":2075},[5943],{"type":47,"value":3889},{"type":41,"tag":2013,"props":5945,"children":5946},{"style":2026},[5947],{"type":47,"value":5729},{"type":41,"tag":2013,"props":5949,"children":5950},{"style":2075},[5951],{"type":47,"value":3899},{"type":41,"tag":2013,"props":5953,"children":5954},{"style":2075},[5955],{"type":47,"value":4008},{"type":41,"tag":2013,"props":5957,"children":5958},{"class":2015,"line":2184},[5959],{"type":41,"tag":2013,"props":5960,"children":5961},{"emptyLinePlaceholder":2581},[5962],{"type":47,"value":2584},{"type":41,"tag":2013,"props":5964,"children":5965},{"class":2015,"line":2640},[5966,5971,5975,5979,5983],{"type":41,"tag":2013,"props":5967,"children":5968},{"style":4031},[5969],{"type":47,"value":5970},"class",{"type":41,"tag":2013,"props":5972,"children":5973},{"style":2020},[5974],{"type":47,"value":4039},{"type":41,"tag":2013,"props":5976,"children":5977},{"style":4031},[5978],{"type":47,"value":4044},{"type":41,"tag":2013,"props":5980,"children":5981},{"style":2020},[5982],{"type":47,"value":3953},{"type":41,"tag":2013,"props":5984,"children":5985},{"style":2075},[5986],{"type":47,"value":4053},{"type":41,"tag":2013,"props":5988,"children":5989},{"class":2015,"line":4083},[5990,5994,5999,6003],{"type":41,"tag":2013,"props":5991,"children":5992},{"style":4031},[5993],{"type":47,"value":4061},{"type":41,"tag":2013,"props":5995,"children":5996},{"style":3912},[5997],{"type":47,"value":5998}," describe",{"type":41,"tag":2013,"props":6000,"children":6001},{"style":2075},[6002],{"type":47,"value":4076},{"type":41,"tag":2013,"props":6004,"children":6005},{"style":2075},[6006],{"type":47,"value":4053},{"type":41,"tag":2013,"props":6008,"children":6009},{"class":2015,"line":4097},[6010,6014,6018,6022,6026,6030,6034,6038,6042,6047,6051,6055,6059,6063,6067,6072,6076,6081,6085,6090,6094,6099],{"type":41,"tag":2013,"props":6011,"children":6012},{"style":3872},[6013],{"type":47,"value":4089},{"type":41,"tag":2013,"props":6015,"children":6016},{"style":2075},[6017],{"type":47,"value":3909},{"type":41,"tag":2013,"props":6019,"children":6020},{"style":3912},[6021],{"type":47,"value":3991},{"type":41,"tag":2013,"props":6023,"children":6024},{"style":2075},[6025],{"type":47,"value":3561},{"type":41,"tag":2013,"props":6027,"children":6028},{"style":2075},[6029],{"type":47,"value":3889},{"type":41,"tag":2013,"props":6031,"children":6032},{"style":2026},[6033],{"type":47,"value":637},{"type":41,"tag":2013,"props":6035,"children":6036},{"style":2075},[6037],{"type":47,"value":3899},{"type":41,"tag":2013,"props":6039,"children":6040},{"style":2075},[6041],{"type":47,"value":3958},{"type":41,"tag":2013,"props":6043,"children":6044},{"style":3912},[6045],{"type":47,"value":6046}," to",{"type":41,"tag":2013,"props":6048,"children":6049},{"style":2075},[6050],{"type":47,"value":3561},{"type":41,"tag":2013,"props":6052,"children":6053},{"style":2075},[6054],{"type":47,"value":3889},{"type":41,"tag":2013,"props":6056,"children":6057},{"style":2026},[6058],{"type":47,"value":637},{"type":41,"tag":2013,"props":6060,"children":6061},{"style":2075},[6062],{"type":47,"value":3899},{"type":41,"tag":2013,"props":6064,"children":6065},{"style":2075},[6066],{"type":47,"value":3958},{"type":41,"tag":2013,"props":6068,"children":6069},{"style":3912},[6070],{"type":47,"value":6071}," labels",{"type":41,"tag":2013,"props":6073,"children":6074},{"style":2075},[6075],{"type":47,"value":3561},{"type":41,"tag":2013,"props":6077,"children":6078},{"style":3912},[6079],{"type":47,"value":6080}," [",{"type":41,"tag":2013,"props":6082,"children":6083},{"style":2075},[6084],{"type":47,"value":3899},{"type":41,"tag":2013,"props":6086,"children":6087},{"style":2026},[6088],{"type":47,"value":6089},"normalize-names",{"type":41,"tag":2013,"props":6091,"children":6092},{"style":2075},[6093],{"type":47,"value":3899},{"type":41,"tag":2013,"props":6095,"children":6096},{"style":3912},[6097],{"type":47,"value":6098},"] ",{"type":41,"tag":2013,"props":6100,"children":6101},{"style":2075},[6102],{"type":47,"value":6103},"};\n",{"type":41,"tag":2013,"props":6105,"children":6106},{"class":2015,"line":4150},[6107],{"type":41,"tag":2013,"props":6108,"children":6109},{"style":2075},[6110],{"type":47,"value":4455},{"type":41,"tag":2013,"props":6112,"children":6113},{"class":2015,"line":4181},[6114],{"type":41,"tag":2013,"props":6115,"children":6116},{"emptyLinePlaceholder":2581},[6117],{"type":47,"value":2584},{"type":41,"tag":2013,"props":6119,"children":6120},{"class":2015,"line":4210},[6121,6125,6129,6133,6137],{"type":41,"tag":2013,"props":6122,"children":6123},{"style":4031},[6124],{"type":47,"value":4061},{"type":41,"tag":2013,"props":6126,"children":6127},{"style":4031},[6128],{"type":47,"value":4066},{"type":41,"tag":2013,"props":6130,"children":6131},{"style":3912},[6132],{"type":47,"value":4071},{"type":41,"tag":2013,"props":6134,"children":6135},{"style":2075},[6136],{"type":47,"value":4076},{"type":41,"tag":2013,"props":6138,"children":6139},{"style":2075},[6140],{"type":47,"value":4053},{"type":41,"tag":2013,"props":6142,"children":6143},{"class":2015,"line":4232},[6144,6148],{"type":41,"tag":2013,"props":6145,"children":6146},{"style":3872},[6147],{"type":47,"value":4089},{"type":41,"tag":2013,"props":6149,"children":6150},{"style":3912},[6151],{"type":47,"value":4094},{"type":41,"tag":2013,"props":6153,"children":6154},{"class":2015,"line":4255},[6155,6160,6164,6168,6172,6176,6180,6184,6188,6193,6197,6201,6205,6209,6213,6218,6222,6227,6231,6236],{"type":41,"tag":2013,"props":6156,"children":6157},{"style":4101},[6158],{"type":47,"value":6159},"      createIndex",{"type":41,"tag":2013,"props":6161,"children":6162},{"style":3912},[6163],{"type":47,"value":4109},{"type":41,"tag":2013,"props":6165,"children":6166},{"style":2075},[6167],{"type":47,"value":3899},{"type":41,"tag":2013,"props":6169,"children":6170},{"style":2026},[6171],{"type":47,"value":5159},{"type":41,"tag":2013,"props":6173,"children":6174},{"style":2075},[6175],{"type":47,"value":3899},{"type":41,"tag":2013,"props":6177,"children":6178},{"style":2075},[6179],{"type":47,"value":3958},{"type":41,"tag":2013,"props":6181,"children":6182},{"style":3912},[6183],{"type":47,"value":6080},{"type":41,"tag":2013,"props":6185,"children":6186},{"style":2075},[6187],{"type":47,"value":5347},{"type":41,"tag":2013,"props":6189,"children":6190},{"style":3912},[6191],{"type":47,"value":6192}," field",{"type":41,"tag":2013,"props":6194,"children":6195},{"style":2075},[6196],{"type":47,"value":3561},{"type":41,"tag":2013,"props":6198,"children":6199},{"style":2075},[6200],{"type":47,"value":3889},{"type":41,"tag":2013,"props":6202,"children":6203},{"style":2026},[6204],{"type":47,"value":4169},{"type":41,"tag":2013,"props":6206,"children":6207},{"style":2075},[6208],{"type":47,"value":3899},{"type":41,"tag":2013,"props":6210,"children":6211},{"style":2075},[6212],{"type":47,"value":3958},{"type":41,"tag":2013,"props":6214,"children":6215},{"style":3912},[6216],{"type":47,"value":6217}," direction",{"type":41,"tag":2013,"props":6219,"children":6220},{"style":2075},[6221],{"type":47,"value":3561},{"type":41,"tag":2013,"props":6223,"children":6224},{"style":5287},[6225],{"type":47,"value":6226}," 1",{"type":41,"tag":2013,"props":6228,"children":6229},{"style":2075},[6230],{"type":47,"value":3986},{"type":41,"tag":2013,"props":6232,"children":6233},{"style":3912},[6234],{"type":47,"value":6235},"])",{"type":41,"tag":2013,"props":6237,"children":6238},{"style":2075},[6239],{"type":47,"value":4178},{"type":41,"tag":2013,"props":6241,"children":6242},{"class":2015,"line":4272},[6243,6248,6252,6256,6261,6265,6269],{"type":41,"tag":2013,"props":6244,"children":6245},{"style":4101},[6246],{"type":47,"value":6247},"      dataTransform",{"type":41,"tag":2013,"props":6249,"children":6250},{"style":3912},[6251],{"type":47,"value":4109},{"type":41,"tag":2013,"props":6253,"children":6254},{"style":2075},[6255],{"type":47,"value":3899},{"type":41,"tag":2013,"props":6257,"children":6258},{"style":2026},[6259],{"type":47,"value":6260},"lowercase-user-name",{"type":41,"tag":2013,"props":6262,"children":6263},{"style":2075},[6264],{"type":47,"value":3899},{"type":41,"tag":2013,"props":6266,"children":6267},{"style":2075},[6268],{"type":47,"value":3958},{"type":41,"tag":2013,"props":6270,"children":6271},{"style":2075},[6272],{"type":47,"value":4053},{"type":41,"tag":2013,"props":6274,"children":6275},{"class":2015,"line":27},[6276,6280,6284],{"type":41,"tag":2013,"props":6277,"children":6278},{"style":3912},[6279],{"type":47,"value":4323},{"type":41,"tag":2013,"props":6281,"children":6282},{"style":2075},[6283],{"type":47,"value":3561},{"type":41,"tag":2013,"props":6285,"children":6286},{"style":2075},[6287],{"type":47,"value":4053},{"type":41,"tag":2013,"props":6289,"children":6290},{"class":2015,"line":4369},[6291,6296,6300,6304,6308,6312],{"type":41,"tag":2013,"props":6292,"children":6293},{"style":4101},[6294],{"type":47,"value":6295},"          source",{"type":41,"tag":2013,"props":6297,"children":6298},{"style":2075},[6299],{"type":47,"value":3561},{"type":41,"tag":2013,"props":6301,"children":6302},{"style":2075},[6303],{"type":47,"value":4332},{"type":41,"tag":2013,"props":6305,"children":6306},{"style":4031},[6307],{"type":47,"value":4337},{"type":41,"tag":2013,"props":6309,"children":6310},{"style":3912},[6311],{"type":47,"value":82},{"type":41,"tag":2013,"props":6313,"children":6314},{"style":2075},[6315],{"type":47,"value":6316},"{\n",{"type":41,"tag":2013,"props":6318,"children":6319},{"class":2015,"line":4420},[6320,6325,6329,6333,6337,6341],{"type":41,"tag":2013,"props":6321,"children":6322},{"style":3912},[6323],{"type":47,"value":6324},"            collection",{"type":41,"tag":2013,"props":6326,"children":6327},{"style":2075},[6328],{"type":47,"value":3561},{"type":41,"tag":2013,"props":6330,"children":6331},{"style":2075},[6332],{"type":47,"value":3889},{"type":41,"tag":2013,"props":6334,"children":6335},{"style":2026},[6336],{"type":47,"value":5159},{"type":41,"tag":2013,"props":6338,"children":6339},{"style":2075},[6340],{"type":47,"value":3899},{"type":41,"tag":2013,"props":6342,"children":6343},{"style":2075},[6344],{"type":47,"value":4178},{"type":41,"tag":2013,"props":6346,"children":6347},{"class":2015,"line":4436},[6348,6353,6357,6362,6366,6370,6374,6378,6382,6386],{"type":41,"tag":2013,"props":6349,"children":6350},{"style":3912},[6351],{"type":47,"value":6352},"            command",{"type":41,"tag":2013,"props":6354,"children":6355},{"style":2075},[6356],{"type":47,"value":3561},{"type":41,"tag":2013,"props":6358,"children":6359},{"style":2075},[6360],{"type":47,"value":6361}," new",{"type":41,"tag":2013,"props":6363,"children":6364},{"style":4101},[6365],{"type":47,"value":5922},{"type":41,"tag":2013,"props":6367,"children":6368},{"style":3912},[6369],{"type":47,"value":4109},{"type":41,"tag":2013,"props":6371,"children":6372},{"style":2075},[6373],{"type":47,"value":3899},{"type":41,"tag":2013,"props":6375,"children":6376},{"style":2026},[6377],{"type":47,"value":5159},{"type":41,"tag":2013,"props":6379,"children":6380},{"style":2075},[6381],{"type":47,"value":3899},{"type":41,"tag":2013,"props":6383,"children":6384},{"style":2075},[6385],{"type":47,"value":3958},{"type":41,"tag":2013,"props":6387,"children":6388},{"style":3912},[6389],{"type":47,"value":4094},{"type":41,"tag":2013,"props":6391,"children":6392},{"class":2015,"line":4449},[6393,6398,6403,6407,6411,6415,6419,6423,6428,6432,6436,6441,6445,6449,6453],{"type":41,"tag":2013,"props":6394,"children":6395},{"style":2075},[6396],{"type":47,"value":6397},"              {",{"type":41,"tag":2013,"props":6399,"children":6400},{"style":3912},[6401],{"type":47,"value":6402}," $match",{"type":41,"tag":2013,"props":6404,"children":6405},{"style":2075},[6406],{"type":47,"value":3561},{"type":41,"tag":2013,"props":6408,"children":6409},{"style":2075},[6410],{"type":47,"value":3909},{"type":41,"tag":2013,"props":6412,"children":6413},{"style":3912},[6414],{"type":47,"value":5352},{"type":41,"tag":2013,"props":6416,"children":6417},{"style":2075},[6418],{"type":47,"value":3561},{"type":41,"tag":2013,"props":6420,"children":6421},{"style":2075},[6422],{"type":47,"value":3909},{"type":41,"tag":2013,"props":6424,"children":6425},{"style":3912},[6426],{"type":47,"value":6427}," $regex",{"type":41,"tag":2013,"props":6429,"children":6430},{"style":2075},[6431],{"type":47,"value":3561},{"type":41,"tag":2013,"props":6433,"children":6434},{"style":2075},[6435],{"type":47,"value":3889},{"type":41,"tag":2013,"props":6437,"children":6438},{"style":2026},[6439],{"type":47,"value":6440},"[A-Z]",{"type":41,"tag":2013,"props":6442,"children":6443},{"style":2075},[6444],{"type":47,"value":3899},{"type":41,"tag":2013,"props":6446,"children":6447},{"style":2075},[6448],{"type":47,"value":3986},{"type":41,"tag":2013,"props":6450,"children":6451},{"style":2075},[6452],{"type":47,"value":3986},{"type":41,"tag":2013,"props":6454,"children":6455},{"style":2075},[6456],{"type":47,"value":6457}," },\n",{"type":41,"tag":2013,"props":6459,"children":6460},{"class":2015,"line":4458},[6461,6465,6470,6474,6478],{"type":41,"tag":2013,"props":6462,"children":6463},{"style":2075},[6464],{"type":47,"value":6397},{"type":41,"tag":2013,"props":6466,"children":6467},{"style":3912},[6468],{"type":47,"value":6469}," $limit",{"type":41,"tag":2013,"props":6471,"children":6472},{"style":2075},[6473],{"type":47,"value":3561},{"type":41,"tag":2013,"props":6475,"children":6476},{"style":5287},[6477],{"type":47,"value":6226},{"type":41,"tag":2013,"props":6479,"children":6480},{"style":2075},[6481],{"type":47,"value":6457},{"type":41,"tag":2013,"props":6483,"children":6484},{"class":2015,"line":4467},[6485,6490],{"type":41,"tag":2013,"props":6486,"children":6487},{"style":3912},[6488],{"type":47,"value":6489},"            ])",{"type":41,"tag":2013,"props":6491,"children":6492},{"style":2075},[6493],{"type":47,"value":4178},{"type":41,"tag":2013,"props":6495,"children":6496},{"class":2015,"line":4475},[6497,6502,6506,6510,6515,6519,6523,6527,6531,6535,6540,6544,6548,6553,6557,6561,6566,6570,6574,6579,6583,6587,6592,6596,6601],{"type":41,"tag":2013,"props":6498,"children":6499},{"style":3912},[6500],{"type":47,"value":6501},"            meta",{"type":41,"tag":2013,"props":6503,"children":6504},{"style":2075},[6505],{"type":47,"value":3561},{"type":41,"tag":2013,"props":6507,"children":6508},{"style":2075},[6509],{"type":47,"value":3909},{"type":41,"tag":2013,"props":6511,"children":6512},{"style":3912},[6513],{"type":47,"value":6514}," target",{"type":41,"tag":2013,"props":6516,"children":6517},{"style":2075},[6518],{"type":47,"value":3561},{"type":41,"tag":2013,"props":6520,"children":6521},{"style":2075},[6522],{"type":47,"value":3889},{"type":41,"tag":2013,"props":6524,"children":6525},{"style":2026},[6526],{"type":47,"value":5672},{"type":41,"tag":2013,"props":6528,"children":6529},{"style":2075},[6530],{"type":47,"value":3899},{"type":41,"tag":2013,"props":6532,"children":6533},{"style":2075},[6534],{"type":47,"value":3958},{"type":41,"tag":2013,"props":6536,"children":6537},{"style":3912},[6538],{"type":47,"value":6539}," storageHash",{"type":41,"tag":2013,"props":6541,"children":6542},{"style":2075},[6543],{"type":47,"value":3561},{"type":41,"tag":2013,"props":6545,"children":6546},{"style":2075},[6547],{"type":47,"value":3889},{"type":41,"tag":2013,"props":6549,"children":6550},{"style":2026},[6551],{"type":47,"value":6552},"…",{"type":41,"tag":2013,"props":6554,"children":6555},{"style":2075},[6556],{"type":47,"value":3899},{"type":41,"tag":2013,"props":6558,"children":6559},{"style":2075},[6560],{"type":47,"value":3958},{"type":41,"tag":2013,"props":6562,"children":6563},{"style":3912},[6564],{"type":47,"value":6565}," lane",{"type":41,"tag":2013,"props":6567,"children":6568},{"style":2075},[6569],{"type":47,"value":3561},{"type":41,"tag":2013,"props":6571,"children":6572},{"style":2075},[6573],{"type":47,"value":3889},{"type":41,"tag":2013,"props":6575,"children":6576},{"style":2026},[6577],{"type":47,"value":6578},"mongo-pipeline",{"type":41,"tag":2013,"props":6580,"children":6581},{"style":2075},[6582],{"type":47,"value":3899},{"type":41,"tag":2013,"props":6584,"children":6585},{"style":2075},[6586],{"type":47,"value":3958},{"type":41,"tag":2013,"props":6588,"children":6589},{"style":3912},[6590],{"type":47,"value":6591}," paramDescriptors",{"type":41,"tag":2013,"props":6593,"children":6594},{"style":2075},[6595],{"type":47,"value":3561},{"type":41,"tag":2013,"props":6597,"children":6598},{"style":3912},[6599],{"type":47,"value":6600}," [] ",{"type":41,"tag":2013,"props":6602,"children":6603},{"style":2075},[6604],{"type":47,"value":6605},"},\n",{"type":41,"tag":2013,"props":6607,"children":6608},{"class":2015,"line":5562},[6609,6614,6618],{"type":41,"tag":2013,"props":6610,"children":6611},{"style":2075},[6612],{"type":47,"value":6613},"          }",{"type":41,"tag":2013,"props":6615,"children":6616},{"style":3912},[6617],{"type":47,"value":91},{"type":41,"tag":2013,"props":6619,"children":6620},{"style":2075},[6621],{"type":47,"value":4178},{"type":41,"tag":2013,"props":6623,"children":6625},{"class":2015,"line":6624},24,[6626],{"type":41,"tag":2013,"props":6627,"children":6628},{"style":2075},[6629],{"type":47,"value":6630},"        },\n",{"type":41,"tag":2013,"props":6632,"children":6634},{"class":2015,"line":6633},25,[6635,6639,6643,6647,6651,6655],{"type":41,"tag":2013,"props":6636,"children":6637},{"style":4101},[6638],{"type":47,"value":4375},{"type":41,"tag":2013,"props":6640,"children":6641},{"style":2075},[6642],{"type":47,"value":3561},{"type":41,"tag":2013,"props":6644,"children":6645},{"style":2075},[6646],{"type":47,"value":4332},{"type":41,"tag":2013,"props":6648,"children":6649},{"style":4031},[6650],{"type":47,"value":4337},{"type":41,"tag":2013,"props":6652,"children":6653},{"style":3912},[6654],{"type":47,"value":82},{"type":41,"tag":2013,"props":6656,"children":6657},{"style":2075},[6658],{"type":47,"value":6316},{"type":41,"tag":2013,"props":6660,"children":6662},{"class":2015,"line":6661},26,[6663,6668,6672,6676,6680,6684],{"type":41,"tag":2013,"props":6664,"children":6665},{"style":3912},[6666],{"type":47,"value":6667},"          collection",{"type":41,"tag":2013,"props":6669,"children":6670},{"style":2075},[6671],{"type":47,"value":3561},{"type":41,"tag":2013,"props":6673,"children":6674},{"style":2075},[6675],{"type":47,"value":3889},{"type":41,"tag":2013,"props":6677,"children":6678},{"style":2026},[6679],{"type":47,"value":5159},{"type":41,"tag":2013,"props":6681,"children":6682},{"style":2075},[6683],{"type":47,"value":3899},{"type":41,"tag":2013,"props":6685,"children":6686},{"style":2075},[6687],{"type":47,"value":4178},{"type":41,"tag":2013,"props":6689,"children":6691},{"class":2015,"line":6690},27,[6692,6697,6701,6705,6709],{"type":41,"tag":2013,"props":6693,"children":6694},{"style":3912},[6695],{"type":47,"value":6696},"          command",{"type":41,"tag":2013,"props":6698,"children":6699},{"style":2075},[6700],{"type":47,"value":3561},{"type":41,"tag":2013,"props":6702,"children":6703},{"style":2075},[6704],{"type":47,"value":6361},{"type":41,"tag":2013,"props":6706,"children":6707},{"style":4101},[6708],{"type":47,"value":5931},{"type":41,"tag":2013,"props":6710,"children":6711},{"style":3912},[6712],{"type":47,"value":6713},"(\n",{"type":41,"tag":2013,"props":6715,"children":6717},{"class":2015,"line":6716},28,[6718,6723,6727,6731],{"type":41,"tag":2013,"props":6719,"children":6720},{"style":2075},[6721],{"type":47,"value":6722},"            '",{"type":41,"tag":2013,"props":6724,"children":6725},{"style":2026},[6726],{"type":47,"value":5159},{"type":41,"tag":2013,"props":6728,"children":6729},{"style":2075},[6730],{"type":47,"value":3899},{"type":41,"tag":2013,"props":6732,"children":6733},{"style":2075},[6734],{"type":47,"value":4178},{"type":41,"tag":2013,"props":6736,"children":6738},{"class":2015,"line":6737},29,[6739,6744,6748,6752,6756,6761,6765,6769,6773],{"type":41,"tag":2013,"props":6740,"children":6741},{"style":2075},[6742],{"type":47,"value":6743},"            {",{"type":41,"tag":2013,"props":6745,"children":6746},{"style":3912},[6747],{"type":47,"value":5352},{"type":41,"tag":2013,"props":6749,"children":6750},{"style":2075},[6751],{"type":47,"value":3561},{"type":41,"tag":2013,"props":6753,"children":6754},{"style":2075},[6755],{"type":47,"value":3909},{"type":41,"tag":2013,"props":6757,"children":6758},{"style":3912},[6759],{"type":47,"value":6760}," $exists",{"type":41,"tag":2013,"props":6762,"children":6763},{"style":2075},[6764],{"type":47,"value":3561},{"type":41,"tag":2013,"props":6766,"children":6767},{"style":4245},[6768],{"type":47,"value":4248},{"type":41,"tag":2013,"props":6770,"children":6771},{"style":2075},[6772],{"type":47,"value":3986},{"type":41,"tag":2013,"props":6774,"children":6775},{"style":2075},[6776],{"type":47,"value":6457},{"type":41,"tag":2013,"props":6778,"children":6780},{"class":2015,"line":6779},30,[6781,6786,6790,6795,6799,6803,6807,6811,6815,6820,6824,6828,6833,6837,6841,6845,6849,6854],{"type":41,"tag":2013,"props":6782,"children":6783},{"style":3912},[6784],{"type":47,"value":6785},"            [",{"type":41,"tag":2013,"props":6787,"children":6788},{"style":2075},[6789],{"type":47,"value":5347},{"type":41,"tag":2013,"props":6791,"children":6792},{"style":3912},[6793],{"type":47,"value":6794}," $set",{"type":41,"tag":2013,"props":6796,"children":6797},{"style":2075},[6798],{"type":47,"value":3561},{"type":41,"tag":2013,"props":6800,"children":6801},{"style":2075},[6802],{"type":47,"value":3909},{"type":41,"tag":2013,"props":6804,"children":6805},{"style":3912},[6806],{"type":47,"value":5352},{"type":41,"tag":2013,"props":6808,"children":6809},{"style":2075},[6810],{"type":47,"value":3561},{"type":41,"tag":2013,"props":6812,"children":6813},{"style":2075},[6814],{"type":47,"value":3909},{"type":41,"tag":2013,"props":6816,"children":6817},{"style":3912},[6818],{"type":47,"value":6819}," $toLower",{"type":41,"tag":2013,"props":6821,"children":6822},{"style":2075},[6823],{"type":47,"value":3561},{"type":41,"tag":2013,"props":6825,"children":6826},{"style":2075},[6827],{"type":47,"value":3889},{"type":41,"tag":2013,"props":6829,"children":6830},{"style":2026},[6831],{"type":47,"value":6832},"$name",{"type":41,"tag":2013,"props":6834,"children":6835},{"style":2075},[6836],{"type":47,"value":3899},{"type":41,"tag":2013,"props":6838,"children":6839},{"style":2075},[6840],{"type":47,"value":3986},{"type":41,"tag":2013,"props":6842,"children":6843},{"style":2075},[6844],{"type":47,"value":3986},{"type":41,"tag":2013,"props":6846,"children":6847},{"style":2075},[6848],{"type":47,"value":3986},{"type":41,"tag":2013,"props":6850,"children":6851},{"style":3912},[6852],{"type":47,"value":6853},"]",{"type":41,"tag":2013,"props":6855,"children":6856},{"style":2075},[6857],{"type":47,"value":4178},{"type":41,"tag":2013,"props":6859,"children":6861},{"class":2015,"line":6860},31,[6862,6867],{"type":41,"tag":2013,"props":6863,"children":6864},{"style":3912},[6865],{"type":47,"value":6866},"          )",{"type":41,"tag":2013,"props":6868,"children":6869},{"style":2075},[6870],{"type":47,"value":4178},{"type":41,"tag":2013,"props":6872,"children":6874},{"class":2015,"line":6873},32,[6875,6880,6884,6888,6892,6896,6900,6904,6908,6912,6916,6920,6924,6928,6932,6936,6940,6944,6948,6953,6957,6961,6965,6969,6973],{"type":41,"tag":2013,"props":6876,"children":6877},{"style":3912},[6878],{"type":47,"value":6879},"          meta",{"type":41,"tag":2013,"props":6881,"children":6882},{"style":2075},[6883],{"type":47,"value":3561},{"type":41,"tag":2013,"props":6885,"children":6886},{"style":2075},[6887],{"type":47,"value":3909},{"type":41,"tag":2013,"props":6889,"children":6890},{"style":3912},[6891],{"type":47,"value":6514},{"type":41,"tag":2013,"props":6893,"children":6894},{"style":2075},[6895],{"type":47,"value":3561},{"type":41,"tag":2013,"props":6897,"children":6898},{"style":2075},[6899],{"type":47,"value":3889},{"type":41,"tag":2013,"props":6901,"children":6902},{"style":2026},[6903],{"type":47,"value":5672},{"type":41,"tag":2013,"props":6905,"children":6906},{"style":2075},[6907],{"type":47,"value":3899},{"type":41,"tag":2013,"props":6909,"children":6910},{"style":2075},[6911],{"type":47,"value":3958},{"type":41,"tag":2013,"props":6913,"children":6914},{"style":3912},[6915],{"type":47,"value":6539},{"type":41,"tag":2013,"props":6917,"children":6918},{"style":2075},[6919],{"type":47,"value":3561},{"type":41,"tag":2013,"props":6921,"children":6922},{"style":2075},[6923],{"type":47,"value":3889},{"type":41,"tag":2013,"props":6925,"children":6926},{"style":2026},[6927],{"type":47,"value":6552},{"type":41,"tag":2013,"props":6929,"children":6930},{"style":2075},[6931],{"type":47,"value":3899},{"type":41,"tag":2013,"props":6933,"children":6934},{"style":2075},[6935],{"type":47,"value":3958},{"type":41,"tag":2013,"props":6937,"children":6938},{"style":3912},[6939],{"type":47,"value":6565},{"type":41,"tag":2013,"props":6941,"children":6942},{"style":2075},[6943],{"type":47,"value":3561},{"type":41,"tag":2013,"props":6945,"children":6946},{"style":2075},[6947],{"type":47,"value":3889},{"type":41,"tag":2013,"props":6949,"children":6950},{"style":2026},[6951],{"type":47,"value":6952},"mongo-raw",{"type":41,"tag":2013,"props":6954,"children":6955},{"style":2075},[6956],{"type":47,"value":3899},{"type":41,"tag":2013,"props":6958,"children":6959},{"style":2075},[6960],{"type":47,"value":3958},{"type":41,"tag":2013,"props":6962,"children":6963},{"style":3912},[6964],{"type":47,"value":6591},{"type":41,"tag":2013,"props":6966,"children":6967},{"style":2075},[6968],{"type":47,"value":3561},{"type":41,"tag":2013,"props":6970,"children":6971},{"style":3912},[6972],{"type":47,"value":6600},{"type":41,"tag":2013,"props":6974,"children":6975},{"style":2075},[6976],{"type":47,"value":6605},{"type":41,"tag":2013,"props":6978,"children":6980},{"class":2015,"line":6979},33,[6981,6986,6990],{"type":41,"tag":2013,"props":6982,"children":6983},{"style":2075},[6984],{"type":47,"value":6985},"        }",{"type":41,"tag":2013,"props":6987,"children":6988},{"style":3912},[6989],{"type":47,"value":91},{"type":41,"tag":2013,"props":6991,"children":6992},{"style":2075},[6993],{"type":47,"value":4178},{"type":41,"tag":2013,"props":6995,"children":6997},{"class":2015,"line":6996},34,[6998,7002,7006],{"type":41,"tag":2013,"props":6999,"children":7000},{"style":2075},[7001],{"type":47,"value":4261},{"type":41,"tag":2013,"props":7003,"children":7004},{"style":3912},[7005],{"type":47,"value":91},{"type":41,"tag":2013,"props":7007,"children":7008},{"style":2075},[7009],{"type":47,"value":4178},{"type":41,"tag":2013,"props":7011,"children":7013},{"class":2015,"line":7012},35,[7014,7018],{"type":41,"tag":2013,"props":7015,"children":7016},{"style":3912},[7017],{"type":47,"value":4442},{"type":41,"tag":2013,"props":7019,"children":7020},{"style":2075},[7021],{"type":47,"value":4008},{"type":41,"tag":2013,"props":7023,"children":7025},{"class":2015,"line":7024},36,[7026],{"type":41,"tag":2013,"props":7027,"children":7028},{"style":2075},[7029],{"type":47,"value":4455},{"type":41,"tag":2013,"props":7031,"children":7033},{"class":2015,"line":7032},37,[7034],{"type":41,"tag":2013,"props":7035,"children":7036},{"style":2075},[7037],{"type":47,"value":4464},{"type":41,"tag":2013,"props":7039,"children":7041},{"class":2015,"line":7040},38,[7042],{"type":41,"tag":2013,"props":7043,"children":7044},{"emptyLinePlaceholder":2581},[7045],{"type":47,"value":2584},{"type":41,"tag":2013,"props":7047,"children":7049},{"class":2015,"line":7048},39,[7050,7054,7058,7062],{"type":41,"tag":2013,"props":7051,"children":7052},{"style":3872},[7053],{"type":47,"value":4023},{"type":41,"tag":2013,"props":7055,"children":7056},{"style":3872},[7057],{"type":47,"value":4028},{"type":41,"tag":2013,"props":7059,"children":7060},{"style":2047},[7061],{"type":47,"value":4039},{"type":41,"tag":2013,"props":7063,"children":7064},{"style":2075},[7065],{"type":47,"value":4008},{"type":41,"tag":2013,"props":7067,"children":7069},{"class":2015,"line":7068},40,[7070,7074,7078,7082,7086,7090,7094,7098,7102,7106,7110,7114],{"type":41,"tag":2013,"props":7071,"children":7072},{"style":2047},[7073],{"type":47,"value":1298},{"type":41,"tag":2013,"props":7075,"children":7076},{"style":2075},[7077],{"type":47,"value":276},{"type":41,"tag":2013,"props":7079,"children":7080},{"style":4101},[7081],{"type":47,"value":831},{"type":41,"tag":2013,"props":7083,"children":7084},{"style":2047},[7085],{"type":47,"value":4109},{"type":41,"tag":2013,"props":7087,"children":7088},{"style":3872},[7089],{"type":47,"value":3875},{"type":41,"tag":2013,"props":7091,"children":7092},{"style":2075},[7093],{"type":47,"value":276},{"type":41,"tag":2013,"props":7095,"children":7096},{"style":2047},[7097],{"type":47,"value":4505},{"type":41,"tag":2013,"props":7099,"children":7100},{"style":2075},[7101],{"type":47,"value":276},{"type":41,"tag":2013,"props":7103,"children":7104},{"style":2047},[7105],{"type":47,"value":4514},{"type":41,"tag":2013,"props":7107,"children":7108},{"style":2075},[7109],{"type":47,"value":3958},{"type":41,"tag":2013,"props":7111,"children":7112},{"style":2047},[7113],{"type":47,"value":4523},{"type":41,"tag":2013,"props":7115,"children":7116},{"style":2075},[7117],{"type":47,"value":4008},{"type":41,"tag":54,"props":7119,"children":7120},{},[7121,7123,7128],{"type":47,"value":7122},"Self-emit the same way: ",{"type":41,"tag":84,"props":7124,"children":7126},{"className":7125},[],[7127],{"type":47,"value":655},{"type":47,"value":276},{"type":41,"tag":203,"props":7130,"children":7132},{"id":7131},"workflow-author-a-migration-by-hand",[7133],{"type":47,"value":7134},"Workflow — Author a migration by hand",{"type":41,"tag":54,"props":7136,"children":7137},{},[7138,7140,7145,7147,7152,7154,7159],{"type":47,"value":7139},"The concept: the same ",{"type":41,"tag":84,"props":7141,"children":7143},{"className":7142},[],[7144],{"type":47,"value":20},{"type":47,"value":7146}," class shape lets you author operations directly when the planner has nothing to plan (a custom data fix, an extension install, a baseline). Even here you don't write the file from scratch — ",{"type":41,"tag":84,"props":7148,"children":7150},{"className":7149},[],[7151],{"type":47,"value":578},{"type":47,"value":7153}," renders an empty package for you, and you edit the ",{"type":41,"tag":84,"props":7155,"children":7157},{"className":7156},[],[7158],{"type":47,"value":714},{"type":47,"value":7160}," getter inside it, then self-emit.",{"type":41,"tag":2002,"props":7162,"children":7164},{"className":2004,"code":7163,"language":2006,"meta":2007,"style":2007},"pnpm prisma-next migration new --name \u003Csnake_slug>\n",[7165],{"type":41,"tag":84,"props":7166,"children":7167},{"__ignoreMap":2007},[7168],{"type":41,"tag":2013,"props":7169,"children":7170},{"class":2015,"line":2016},[7171,7175,7179,7183,7187,7191,7195,7199,7203],{"type":41,"tag":2013,"props":7172,"children":7173},{"style":2020},[7174],{"type":47,"value":2023},{"type":41,"tag":2013,"props":7176,"children":7177},{"style":2026},[7178],{"type":47,"value":2029},{"type":41,"tag":2013,"props":7180,"children":7181},{"style":2026},[7182],{"type":47,"value":2141},{"type":41,"tag":2013,"props":7184,"children":7185},{"style":2026},[7186],{"type":47,"value":6361},{"type":41,"tag":2013,"props":7188,"children":7189},{"style":2026},[7190],{"type":47,"value":2151},{"type":41,"tag":2013,"props":7192,"children":7193},{"style":2075},[7194],{"type":47,"value":2622},{"type":41,"tag":2013,"props":7196,"children":7197},{"style":2026},[7198],{"type":47,"value":3372},{"type":41,"tag":2013,"props":7200,"children":7201},{"style":2047},[7202],{"type":47,"value":3377},{"type":41,"tag":2013,"props":7204,"children":7205},{"style":2075},[7206],{"type":47,"value":2637},{"type":41,"tag":54,"props":7208,"children":7209},{},[7210,7212,7217,7218,7223,7225,7231],{"type":47,"value":7211},"Add factory names to the framework-rendered import line for your target (Postgres: ",{"type":41,"tag":84,"props":7213,"children":7215},{"className":7214},[],[7216],{"type":47,"value":706},{"type":47,"value":1354},{"type":41,"tag":84,"props":7219,"children":7221},{"className":7220},[],[7222],{"type":47,"value":1277},{"type":47,"value":7224},"). Browse with ",{"type":41,"tag":84,"props":7226,"children":7228},{"className":7227},[],[7229],{"type":47,"value":7230},"--help",{"type":47,"value":7232}," and the import list the renderer emitted.",{"type":41,"tag":54,"props":7234,"children":7235},{},[7236,7240],{"type":41,"tag":58,"props":7237,"children":7238},{},[7239],{"type":47,"value":169},{"type":47,"value":7241}," factories (representative set):",{"type":41,"tag":210,"props":7243,"children":7244},{},[7245,7264,7317,7350,7368,7401,7427,7439],{"type":41,"tag":73,"props":7246,"children":7247},{},[7248,7250,7256,7257,7263],{"type":47,"value":7249},"Tables: ",{"type":41,"tag":84,"props":7251,"children":7253},{"className":7252},[],[7254],{"type":47,"value":7255},"createTable",{"type":47,"value":240},{"type":41,"tag":84,"props":7258,"children":7260},{"className":7259},[],[7261],{"type":47,"value":7262},"dropTable",{"type":47,"value":276},{"type":41,"tag":73,"props":7265,"children":7266},{},[7267,7269,7275,7276,7282,7283,7289,7290,7295,7296,7302,7303,7309,7310,7316],{"type":47,"value":7268},"Columns: ",{"type":41,"tag":84,"props":7270,"children":7272},{"className":7271},[],[7273],{"type":47,"value":7274},"addColumn",{"type":47,"value":240},{"type":41,"tag":84,"props":7277,"children":7279},{"className":7278},[],[7280],{"type":47,"value":7281},"dropColumn",{"type":47,"value":240},{"type":41,"tag":84,"props":7284,"children":7286},{"className":7285},[],[7287],{"type":47,"value":7288},"alterColumnType",{"type":47,"value":240},{"type":41,"tag":84,"props":7291,"children":7293},{"className":7292},[],[7294],{"type":47,"value":4652},{"type":47,"value":240},{"type":41,"tag":84,"props":7297,"children":7299},{"className":7298},[],[7300],{"type":47,"value":7301},"dropNotNull",{"type":47,"value":240},{"type":41,"tag":84,"props":7304,"children":7306},{"className":7305},[],[7307],{"type":47,"value":7308},"setDefault",{"type":47,"value":240},{"type":41,"tag":84,"props":7311,"children":7313},{"className":7312},[],[7314],{"type":47,"value":7315},"dropDefault",{"type":47,"value":276},{"type":41,"tag":73,"props":7318,"children":7319},{},[7320,7322,7328,7329,7335,7336,7342,7343,7349],{"type":47,"value":7321},"Constraints: ",{"type":41,"tag":84,"props":7323,"children":7325},{"className":7324},[],[7326],{"type":47,"value":7327},"addPrimaryKey",{"type":47,"value":240},{"type":41,"tag":84,"props":7330,"children":7332},{"className":7331},[],[7333],{"type":47,"value":7334},"addForeignKey",{"type":47,"value":240},{"type":41,"tag":84,"props":7337,"children":7339},{"className":7338},[],[7340],{"type":47,"value":7341},"addUnique",{"type":47,"value":240},{"type":41,"tag":84,"props":7344,"children":7346},{"className":7345},[],[7347],{"type":47,"value":7348},"dropConstraint",{"type":47,"value":276},{"type":41,"tag":73,"props":7351,"children":7352},{},[7353,7355,7360,7361,7367],{"type":47,"value":7354},"Indexes: ",{"type":41,"tag":84,"props":7356,"children":7358},{"className":7357},[],[7359],{"type":47,"value":1046},{"type":47,"value":240},{"type":41,"tag":84,"props":7362,"children":7364},{"className":7363},[],[7365],{"type":47,"value":7366},"dropIndex",{"type":47,"value":276},{"type":41,"tag":73,"props":7369,"children":7370},{},[7371,7373,7379,7380,7386,7387,7393,7394,7400],{"type":47,"value":7372},"Enums: ",{"type":41,"tag":84,"props":7374,"children":7376},{"className":7375},[],[7377],{"type":47,"value":7378},"createEnumType",{"type":47,"value":240},{"type":41,"tag":84,"props":7381,"children":7383},{"className":7382},[],[7384],{"type":47,"value":7385},"addEnumValues",{"type":47,"value":240},{"type":41,"tag":84,"props":7388,"children":7390},{"className":7389},[],[7391],{"type":47,"value":7392},"renameType",{"type":47,"value":240},{"type":41,"tag":84,"props":7395,"children":7397},{"className":7396},[],[7398],{"type":47,"value":7399},"dropEnumType",{"type":47,"value":276},{"type":41,"tag":73,"props":7402,"children":7403},{},[7404,7406,7412,7413,7419,7420,7426],{"type":47,"value":7405},"Dependencies: ",{"type":41,"tag":84,"props":7407,"children":7409},{"className":7408},[],[7410],{"type":47,"value":7411},"createSchema",{"type":47,"value":240},{"type":41,"tag":84,"props":7414,"children":7416},{"className":7415},[],[7417],{"type":47,"value":7418},"createExtension",{"type":47,"value":240},{"type":41,"tag":84,"props":7421,"children":7423},{"className":7422},[],[7424],{"type":47,"value":7425},"installExtension",{"type":47,"value":276},{"type":41,"tag":73,"props":7428,"children":7429},{},[7430,7432,7438],{"type":47,"value":7431},"Raw escape hatch: ",{"type":41,"tag":84,"props":7433,"children":7435},{"className":7434},[],[7436],{"type":47,"value":7437},"rawSql({ id, label, operationClass, target, precheck, execute, postcheck, ... })",{"type":47,"value":276},{"type":41,"tag":73,"props":7440,"children":7441},{},[7442,7444,7449],{"type":47,"value":7443},"Data transforms: ",{"type":41,"tag":84,"props":7445,"children":7447},{"className":7446},[],[7448],{"type":47,"value":814},{"type":47,"value":7450}," (instance method, not a free factory).",{"type":41,"tag":54,"props":7452,"children":7453},{},[7454,7458,7460,7465],{"type":41,"tag":58,"props":7455,"children":7456},{},[7457],{"type":47,"value":175},{"type":47,"value":7459}," factories (from ",{"type":41,"tag":84,"props":7461,"children":7463},{"className":7462},[],[7464],{"type":47,"value":1277},{"type":47,"value":7466},"):",{"type":41,"tag":210,"props":7468,"children":7469},{},[7470,7501,7517,7528],{"type":41,"tag":73,"props":7471,"children":7472},{},[7473,7475,7480,7481,7487,7488,7494,7495,7500],{"type":47,"value":7474},"Collections: ",{"type":41,"tag":84,"props":7476,"children":7478},{"className":7477},[],[7479],{"type":47,"value":1039},{"type":47,"value":240},{"type":41,"tag":84,"props":7482,"children":7484},{"className":7483},[],[7485],{"type":47,"value":7486},"dropCollection",{"type":47,"value":240},{"type":41,"tag":84,"props":7489,"children":7491},{"className":7490},[],[7492],{"type":47,"value":7493},"validatedCollection",{"type":47,"value":240},{"type":41,"tag":84,"props":7496,"children":7498},{"className":7497},[],[7499],{"type":47,"value":1060},{"type":47,"value":276},{"type":41,"tag":73,"props":7502,"children":7503},{},[7504,7505,7510,7511,7516],{"type":47,"value":7354},{"type":41,"tag":84,"props":7506,"children":7508},{"className":7507},[],[7509],{"type":47,"value":1046},{"type":47,"value":240},{"type":41,"tag":84,"props":7512,"children":7514},{"className":7513},[],[7515],{"type":47,"value":7366},{"type":47,"value":276},{"type":41,"tag":73,"props":7518,"children":7519},{},[7520,7522,7527],{"type":47,"value":7521},"Collection options: ",{"type":41,"tag":84,"props":7523,"children":7525},{"className":7524},[],[7526],{"type":47,"value":1053},{"type":47,"value":276},{"type":41,"tag":73,"props":7529,"children":7530},{},[7531,7532,7538,7540,7545,7547,7552],{"type":47,"value":7443},{"type":41,"tag":84,"props":7533,"children":7535},{"className":7534},[],[7536],{"type":47,"value":7537},"dataTransform(name, { check, run })",{"type":47,"value":7539}," (free factory; ",{"type":41,"tag":84,"props":7541,"children":7543},{"className":7542},[],[7544],{"type":47,"value":823},{"type":47,"value":7546},"\u002F",{"type":41,"tag":84,"props":7548,"children":7550},{"className":7549},[],[7551],{"type":47,"value":831},{"type":47,"value":7553}," use Mongo query-plan shapes).",{"type":41,"tag":54,"props":7555,"children":7556},{},[7557,7559,7564],{"type":47,"value":7558},"Self-emit (",{"type":41,"tag":84,"props":7560,"children":7562},{"className":7561},[],[7563],{"type":47,"value":655},{"type":47,"value":7565},") after each edit.",{"type":41,"tag":203,"props":7567,"children":7569},{"id":7568},"workflow-inspect-the-live-schema",[7570],{"type":47,"value":7571},"Workflow — Inspect the live schema",{"type":41,"tag":54,"props":7573,"children":7574},{},[7575,7576,7581,7583,7589],{"type":47,"value":2968},{"type":41,"tag":84,"props":7577,"children":7579},{"className":7578},[],[7580],{"type":47,"value":1083},{"type":47,"value":7582}," is read-only and never writes files. It prints the live schema as a tree by default or as JSON with ",{"type":41,"tag":84,"props":7584,"children":7586},{"className":7585},[],[7587],{"type":47,"value":7588},"--json",{"type":47,"value":7590},". Use it during planning and as part of verification.",{"type":41,"tag":2002,"props":7592,"children":7594},{"className":2004,"code":7593,"language":2006,"meta":2007,"style":2007},"pnpm prisma-next db schema --db $DATABASE_URL\npnpm prisma-next db schema --db $DATABASE_URL --json > schema.json\n",[7595],{"type":41,"tag":84,"props":7596,"children":7597},{"__ignoreMap":2007},[7598,7626],{"type":41,"tag":2013,"props":7599,"children":7600},{"class":2015,"line":2016},[7601,7605,7609,7613,7618,7622],{"type":41,"tag":2013,"props":7602,"children":7603},{"style":2020},[7604],{"type":47,"value":2023},{"type":41,"tag":2013,"props":7606,"children":7607},{"style":2026},[7608],{"type":47,"value":2029},{"type":41,"tag":2013,"props":7610,"children":7611},{"style":2026},[7612],{"type":47,"value":2034},{"type":41,"tag":2013,"props":7614,"children":7615},{"style":2026},[7616],{"type":47,"value":7617}," schema",{"type":41,"tag":2013,"props":7619,"children":7620},{"style":2026},[7621],{"type":47,"value":2044},{"type":41,"tag":2013,"props":7623,"children":7624},{"style":2047},[7625],{"type":47,"value":2050},{"type":41,"tag":2013,"props":7627,"children":7628},{"class":2015,"line":2053},[7629,7633,7637,7641,7645,7649,7653,7657,7662],{"type":41,"tag":2013,"props":7630,"children":7631},{"style":2020},[7632],{"type":47,"value":2023},{"type":41,"tag":2013,"props":7634,"children":7635},{"style":2026},[7636],{"type":47,"value":2029},{"type":41,"tag":2013,"props":7638,"children":7639},{"style":2026},[7640],{"type":47,"value":2034},{"type":41,"tag":2013,"props":7642,"children":7643},{"style":2026},[7644],{"type":47,"value":7617},{"type":41,"tag":2013,"props":7646,"children":7647},{"style":2026},[7648],{"type":47,"value":2044},{"type":41,"tag":2013,"props":7650,"children":7651},{"style":2047},[7652],{"type":47,"value":3102},{"type":41,"tag":2013,"props":7654,"children":7655},{"style":2026},[7656],{"type":47,"value":7588},{"type":41,"tag":2013,"props":7658,"children":7659},{"style":2075},[7660],{"type":47,"value":7661}," >",{"type":41,"tag":2013,"props":7663,"children":7664},{"style":2026},[7665],{"type":47,"value":7666}," schema.json\n",{"type":41,"tag":54,"props":7668,"children":7669},{},[7670,7672,7678],{"type":47,"value":7671},"There is no built-in filter flag — pipe the JSON through ",{"type":41,"tag":84,"props":7673,"children":7675},{"className":7674},[],[7676],{"type":47,"value":7677},"jq",{"type":47,"value":7679}," (or your favourite JSON tool) if you only want one table.",{"type":41,"tag":203,"props":7681,"children":7683},{"id":7682},"workflow-verify-contract-vs-db-diagnostic",[7684],{"type":47,"value":7685},"Workflow — Verify contract vs DB (diagnostic)",{"type":41,"tag":54,"props":7687,"children":7688},{},[7689,7690,7695,7696,7701,7703,7708,7709,7714,7716,7721],{"type":47,"value":2968},{"type":41,"tag":84,"props":7691,"children":7693},{"className":7692},[],[7694],{"type":47,"value":1076},{"type":47,"value":2882},{"type":41,"tag":58,"props":7697,"children":7698},{},[7699],{"type":47,"value":7700},"standalone diagnostic",{"type":47,"value":7702}," — not a routine step after ",{"type":41,"tag":84,"props":7704,"children":7706},{"className":7705},[],[7707],{"type":47,"value":129},{"type":47,"value":2997},{"type":41,"tag":84,"props":7710,"children":7712},{"className":7711},[],[7713],{"type":47,"value":145},{"type":47,"value":7715}," on the happy path (those commands already verify and advance the marker when they succeed). Reach for ",{"type":41,"tag":84,"props":7717,"children":7719},{"className":7718},[],[7720],{"type":47,"value":1076},{"type":47,"value":7722}," when you suspect drift or need to prove the DB matches the contract:",{"type":41,"tag":210,"props":7724,"children":7725},{},[7726,7731,7736,7748],{"type":41,"tag":73,"props":7727,"children":7728},{},[7729],{"type":47,"value":7730},"Following manual SQL or ad-hoc edits outside Prisma Next.",{"type":41,"tag":73,"props":7732,"children":7733},{},[7734],{"type":47,"value":7735},"When restoring a database from backup.",{"type":41,"tag":73,"props":7737,"children":7738},{},[7739,7741,7746],{"type":47,"value":7740},"If a ",{"type":41,"tag":84,"props":7742,"children":7744},{"className":7743},[],[7745],{"type":47,"value":145},{"type":47,"value":7747}," fails or partially applies (especially on Mongo, where DDL is resumable rather than transaction-wrapped).",{"type":41,"tag":73,"props":7749,"children":7750},{},[7751,7753,7758,7759,7764],{"type":47,"value":7752},"When ",{"type":41,"tag":84,"props":7754,"children":7756},{"className":7755},[],[7757],{"type":47,"value":1682},{"type":47,"value":482},{"type":41,"tag":84,"props":7760,"children":7762},{"className":7761},[],[7763],{"type":47,"value":1743},{"type":47,"value":7765}," surfaces at runtime or from another command.",{"type":41,"tag":54,"props":7767,"children":7768},{},[7769],{"type":47,"value":7770},"Modes:",{"type":41,"tag":210,"props":7772,"children":7773},{},[7774,7779,7790,7801],{"type":41,"tag":73,"props":7775,"children":7776},{},[7777],{"type":47,"value":7778},"Default — full verification (schema + marker).",{"type":41,"tag":73,"props":7780,"children":7781},{},[7782,7788],{"type":41,"tag":84,"props":7783,"children":7785},{"className":7784},[],[7786],{"type":47,"value":7787},"--marker-only",{"type":47,"value":7789}," — skip schema verification, only check the marker.",{"type":41,"tag":73,"props":7791,"children":7792},{},[7793,7799],{"type":41,"tag":84,"props":7794,"children":7796},{"className":7795},[],[7797],{"type":47,"value":7798},"--schema-only",{"type":47,"value":7800}," — skip marker verification, only check schema satisfies contract.",{"type":41,"tag":73,"props":7802,"children":7803},{},[7804,7810],{"type":41,"tag":84,"props":7805,"children":7807},{"className":7806},[],[7808],{"type":47,"value":7809},"--strict",{"type":47,"value":7811}," adds: schema elements not present in the contract are an error (default is \"DB may have extras\").",{"type":41,"tag":2002,"props":7813,"children":7815},{"className":2004,"code":7814,"language":2006,"meta":2007,"style":2007},"pnpm prisma-next db verify --db $DATABASE_URL\n",[7816],{"type":41,"tag":84,"props":7817,"children":7818},{"__ignoreMap":2007},[7819],{"type":41,"tag":2013,"props":7820,"children":7821},{"class":2015,"line":2016},[7822,7826,7830,7834,7838,7842],{"type":41,"tag":2013,"props":7823,"children":7824},{"style":2020},[7825],{"type":47,"value":2023},{"type":41,"tag":2013,"props":7827,"children":7828},{"style":2026},[7829],{"type":47,"value":2029},{"type":41,"tag":2013,"props":7831,"children":7832},{"style":2026},[7833],{"type":47,"value":2034},{"type":41,"tag":2013,"props":7835,"children":7836},{"style":2026},[7837],{"type":47,"value":2202},{"type":41,"tag":2013,"props":7839,"children":7840},{"style":2026},[7841],{"type":47,"value":2044},{"type":41,"tag":2013,"props":7843,"children":7844},{"style":2047},[7845],{"type":47,"value":2050},{"type":41,"tag":54,"props":7847,"children":7848},{},[7849,7851,7856,7858,7863],{"type":47,"value":7850},"On mismatch, the error envelope names the failure mode (",{"type":41,"tag":84,"props":7852,"children":7854},{"className":7853},[],[7855],{"type":47,"value":1682},{"type":47,"value":7857}," hash mismatch, ",{"type":41,"tag":84,"props":7859,"children":7861},{"className":7860},[],[7862],{"type":47,"value":1743},{"type":47,"value":7864}," marker missing, target mismatch, schema issues with structured paths).",{"type":41,"tag":203,"props":7866,"children":7868},{"id":7867},"workflow-re-sign-the-marker",[7869],{"type":47,"value":7870},"Workflow — Re-sign the marker",{"type":41,"tag":54,"props":7872,"children":7873},{},[7874,7875,7880,7882,7887],{"type":47,"value":2968},{"type":41,"tag":84,"props":7876,"children":7878},{"className":7877},[],[7879],{"type":47,"value":994},{"type":47,"value":7881}," rewrites the marker to the current contract hash. Use after a manual repair where the DB is the source of truth and the marker is stale. ",{"type":41,"tag":84,"props":7883,"children":7885},{"className":7884},[],[7886],{"type":47,"value":994},{"type":47,"value":7888}," performs a schema-verify first and refuses to sign a DB whose schema disagrees with the contract — so a successful sign always means the schema matches and the marker is now correct.",{"type":41,"tag":2002,"props":7890,"children":7892},{"className":2004,"code":7891,"language":2006,"meta":2007,"style":2007},"pnpm prisma-next db sign --db $DATABASE_URL\n",[7893],{"type":41,"tag":84,"props":7894,"children":7895},{"__ignoreMap":2007},[7896],{"type":41,"tag":2013,"props":7897,"children":7898},{"class":2015,"line":2016},[7899,7903,7907,7911,7916,7920],{"type":41,"tag":2013,"props":7900,"children":7901},{"style":2020},[7902],{"type":47,"value":2023},{"type":41,"tag":2013,"props":7904,"children":7905},{"style":2026},[7906],{"type":47,"value":2029},{"type":41,"tag":2013,"props":7908,"children":7909},{"style":2026},[7910],{"type":47,"value":2034},{"type":41,"tag":2013,"props":7912,"children":7913},{"style":2026},[7914],{"type":47,"value":7915}," sign",{"type":41,"tag":2013,"props":7917,"children":7918},{"style":2026},[7919],{"type":47,"value":2044},{"type":41,"tag":2013,"props":7921,"children":7922},{"style":2047},[7923],{"type":47,"value":2050},{"type":41,"tag":203,"props":7925,"children":7927},{"id":7926},"workflow-recover-from-drift",[7928],{"type":47,"value":7929},"Workflow — Recover from drift",{"type":41,"tag":54,"props":7931,"children":7932},{},[7933,7935,7940],{"type":47,"value":7934},"The concept: drift means ",{"type":41,"tag":84,"props":7936,"children":7938},{"className":7937},[],[7939],{"type":47,"value":1076},{"type":47,"value":7941}," reports the live DB schema doesn't match what the marker says it should be. Two valid moves, picked by which side is correct:",{"type":41,"tag":210,"props":7943,"children":7944},{},[7945,7975],{"type":41,"tag":73,"props":7946,"children":7947},{},[7948,7953,7955,7960,7962,7967,7968,7973],{"type":41,"tag":58,"props":7949,"children":7950},{},[7951],{"type":47,"value":7952},"The contract is right; the DB is wrong",{"type":47,"value":7954}," → run a migration. Either ",{"type":41,"tag":84,"props":7956,"children":7958},{"className":7957},[],[7959],{"type":47,"value":129},{"type":47,"value":7961}," (quick path, dev DB only) or ",{"type":41,"tag":84,"props":7963,"children":7965},{"className":7964},[],[7966],{"type":47,"value":137},{"type":47,"value":139},{"type":41,"tag":84,"props":7969,"children":7971},{"className":7970},[],[7972],{"type":47,"value":145},{"type":47,"value":7974}," (everywhere else).",{"type":41,"tag":73,"props":7976,"children":7977},{},[7978,7983,7985,7990,7992,7997],{"type":41,"tag":58,"props":7979,"children":7980},{},[7981],{"type":47,"value":7982},"The DB is right; the contract or marker is wrong",{"type":47,"value":7984}," → edit the contract to match the DB (see ",{"type":41,"tag":84,"props":7986,"children":7988},{"className":7987},[],[7989],{"type":47,"value":89},{"type":47,"value":7991},"), emit, then ",{"type":41,"tag":84,"props":7993,"children":7995},{"className":7994},[],[7996],{"type":47,"value":994},{"type":47,"value":7998}," to refresh the marker.",{"type":41,"tag":54,"props":8000,"children":8001},{},[8002],{"type":47,"value":8003},"The diagnostic that reveals which side is right:",{"type":41,"tag":2002,"props":8005,"children":8007},{"className":2004,"code":8006,"language":2006,"meta":2007,"style":2007},"pnpm prisma-next db schema --db $DATABASE_URL --json\npnpm prisma-next db verify --db $DATABASE_URL --json\n",[8008],{"type":41,"tag":84,"props":8009,"children":8010},{"__ignoreMap":2007},[8011,8042],{"type":41,"tag":2013,"props":8012,"children":8013},{"class":2015,"line":2016},[8014,8018,8022,8026,8030,8034,8038],{"type":41,"tag":2013,"props":8015,"children":8016},{"style":2020},[8017],{"type":47,"value":2023},{"type":41,"tag":2013,"props":8019,"children":8020},{"style":2026},[8021],{"type":47,"value":2029},{"type":41,"tag":2013,"props":8023,"children":8024},{"style":2026},[8025],{"type":47,"value":2034},{"type":41,"tag":2013,"props":8027,"children":8028},{"style":2026},[8029],{"type":47,"value":7617},{"type":41,"tag":2013,"props":8031,"children":8032},{"style":2026},[8033],{"type":47,"value":2044},{"type":41,"tag":2013,"props":8035,"children":8036},{"style":2047},[8037],{"type":47,"value":3102},{"type":41,"tag":2013,"props":8039,"children":8040},{"style":2026},[8041],{"type":47,"value":3208},{"type":41,"tag":2013,"props":8043,"children":8044},{"class":2015,"line":2053},[8045,8049,8053,8057,8061,8065,8069],{"type":41,"tag":2013,"props":8046,"children":8047},{"style":2020},[8048],{"type":47,"value":2023},{"type":41,"tag":2013,"props":8050,"children":8051},{"style":2026},[8052],{"type":47,"value":2029},{"type":41,"tag":2013,"props":8054,"children":8055},{"style":2026},[8056],{"type":47,"value":2034},{"type":41,"tag":2013,"props":8058,"children":8059},{"style":2026},[8060],{"type":47,"value":2202},{"type":41,"tag":2013,"props":8062,"children":8063},{"style":2026},[8064],{"type":47,"value":2044},{"type":41,"tag":2013,"props":8066,"children":8067},{"style":2047},[8068],{"type":47,"value":3102},{"type":41,"tag":2013,"props":8070,"children":8071},{"style":2026},[8072],{"type":47,"value":3208},{"type":41,"tag":54,"props":8074,"children":8075},{},[8076,8078,8083,8085,8091],{"type":47,"value":8077},"Use ",{"type":41,"tag":84,"props":8079,"children":8081},{"className":8080},[],[8082],{"type":47,"value":1076},{"type":47,"value":8084}," to confirm which side is wrong, then re-run it after either branch until it returns ",{"type":41,"tag":84,"props":8086,"children":8088},{"className":8087},[],[8089],{"type":47,"value":8090},"ok",{"type":47,"value":8092}," with no diagnostics.",{"type":41,"tag":203,"props":8094,"children":8096},{"id":8095},"workflow-recover-from-a-partially-applied-migration",[8097],{"type":47,"value":8098},"Workflow — Recover from a partially-applied migration",{"type":41,"tag":54,"props":8100,"children":8101},{},[8102,8104,8108,8110,8115,8117,8121,8123,8128,8129,8134,8136,8141,8143,8148],{"type":47,"value":8103},"The concept: on ",{"type":41,"tag":58,"props":8105,"children":8106},{},[8107],{"type":47,"value":169},{"type":47,"value":8109},", each migration applies inside a transaction — a mid-migration failure rolls back and the marker stays at the previous migration's ",{"type":41,"tag":84,"props":8111,"children":8113},{"className":8112},[],[8114],{"type":47,"value":1025},{"type":47,"value":8116}," hash. On ",{"type":41,"tag":58,"props":8118,"children":8119},{},[8120],{"type":47,"value":175},{"type":47,"value":8122},", DDL is resumable with verify-gated marker advancement; diagnose with ",{"type":41,"tag":84,"props":8124,"children":8126},{"className":8125},[],[8127],{"type":47,"value":1076},{"type":47,"value":482},{"type":41,"tag":84,"props":8130,"children":8132},{"className":8131},[],[8133],{"type":47,"value":1083},{"type":47,"value":8135},", fix the failed package's ",{"type":41,"tag":84,"props":8137,"children":8139},{"className":8138},[],[8140],{"type":47,"value":115},{"type":47,"value":8142},", self-emit, and re-run ",{"type":41,"tag":84,"props":8144,"children":8146},{"className":8145},[],[8147],{"type":47,"value":145},{"type":47,"value":276},{"type":41,"tag":54,"props":8150,"children":8151},{},[8152,8154,8159,8161,8167,8169,8174],{"type":47,"value":8153},"Failures that ",{"type":41,"tag":255,"props":8155,"children":8156},{},[8157],{"type":47,"value":8158},"can",{"type":47,"value":8160}," leak partial state include: Postgres ",{"type":41,"tag":84,"props":8162,"children":8164},{"className":8163},[],[8165],{"type":47,"value":8166},"rawSql(...)",{"type":47,"value":8168}," steps outside the transaction wrapper, Mongo DDL that partially applied before verify failed, or external side-effects (calls out to other systems from a ",{"type":41,"tag":84,"props":8170,"children":8172},{"className":8171},[],[8173],{"type":47,"value":831},{"type":47,"value":8175}," closure).",{"type":41,"tag":54,"props":8177,"children":8178},{},[8179],{"type":47,"value":8180},"Diagnose:",{"type":41,"tag":2002,"props":8182,"children":8184},{"className":2004,"code":8183,"language":2006,"meta":2007,"style":2007},"pnpm prisma-next db verify --db $DATABASE_URL --json\npnpm prisma-next db schema --db $DATABASE_URL --json\n",[8185],{"type":41,"tag":84,"props":8186,"children":8187},{"__ignoreMap":2007},[8188,8219],{"type":41,"tag":2013,"props":8189,"children":8190},{"class":2015,"line":2016},[8191,8195,8199,8203,8207,8211,8215],{"type":41,"tag":2013,"props":8192,"children":8193},{"style":2020},[8194],{"type":47,"value":2023},{"type":41,"tag":2013,"props":8196,"children":8197},{"style":2026},[8198],{"type":47,"value":2029},{"type":41,"tag":2013,"props":8200,"children":8201},{"style":2026},[8202],{"type":47,"value":2034},{"type":41,"tag":2013,"props":8204,"children":8205},{"style":2026},[8206],{"type":47,"value":2202},{"type":41,"tag":2013,"props":8208,"children":8209},{"style":2026},[8210],{"type":47,"value":2044},{"type":41,"tag":2013,"props":8212,"children":8213},{"style":2047},[8214],{"type":47,"value":3102},{"type":41,"tag":2013,"props":8216,"children":8217},{"style":2026},[8218],{"type":47,"value":3208},{"type":41,"tag":2013,"props":8220,"children":8221},{"class":2015,"line":2053},[8222,8226,8230,8234,8238,8242,8246],{"type":41,"tag":2013,"props":8223,"children":8224},{"style":2020},[8225],{"type":47,"value":2023},{"type":41,"tag":2013,"props":8227,"children":8228},{"style":2026},[8229],{"type":47,"value":2029},{"type":41,"tag":2013,"props":8231,"children":8232},{"style":2026},[8233],{"type":47,"value":2034},{"type":41,"tag":2013,"props":8235,"children":8236},{"style":2026},[8237],{"type":47,"value":7617},{"type":41,"tag":2013,"props":8239,"children":8240},{"style":2026},[8241],{"type":47,"value":2044},{"type":41,"tag":2013,"props":8243,"children":8244},{"style":2047},[8245],{"type":47,"value":3102},{"type":41,"tag":2013,"props":8247,"children":8248},{"style":2026},[8249],{"type":47,"value":3208},{"type":41,"tag":54,"props":8251,"children":8252},{},[8253,8255,8260],{"type":47,"value":8254},"Fix and re-run ",{"type":41,"tag":84,"props":8256,"children":8258},{"className":8257},[],[8259],{"type":47,"value":145},{"type":47,"value":3561},{"type":41,"tag":2002,"props":8262,"children":8264},{"className":2004,"code":8263,"language":2006,"meta":2007,"style":2007},"node migrations\u002Fapp\u002F\u003Cdir>\u002Fmigration.ts\npnpm prisma-next migrate --db $DATABASE_URL\n",[8265],{"type":41,"tag":84,"props":8266,"children":8267},{"__ignoreMap":2007},[8268,8304],{"type":41,"tag":2013,"props":8269,"children":8270},{"class":2015,"line":2016},[8271,8275,8280,8285,8290,8295,8299],{"type":41,"tag":2013,"props":8272,"children":8273},{"style":2020},[8274],{"type":47,"value":5631},{"type":41,"tag":2013,"props":8276,"children":8277},{"style":2026},[8278],{"type":47,"value":8279}," migrations\u002Fapp\u002F",{"type":41,"tag":2013,"props":8281,"children":8282},{"style":2075},[8283],{"type":47,"value":8284},"\u003C",{"type":41,"tag":2013,"props":8286,"children":8287},{"style":2026},[8288],{"type":47,"value":8289},"di",{"type":41,"tag":2013,"props":8291,"children":8292},{"style":2047},[8293],{"type":47,"value":8294},"r",{"type":41,"tag":2013,"props":8296,"children":8297},{"style":2075},[8298],{"type":47,"value":3661},{"type":41,"tag":2013,"props":8300,"children":8301},{"style":2026},[8302],{"type":47,"value":8303},"\u002Fmigration.ts\n",{"type":41,"tag":2013,"props":8305,"children":8306},{"class":2015,"line":2053},[8307,8311,8315,8319,8323],{"type":41,"tag":2013,"props":8308,"children":8309},{"style":2020},[8310],{"type":47,"value":2023},{"type":41,"tag":2013,"props":8312,"children":8313},{"style":2026},[8314],{"type":47,"value":2029},{"type":41,"tag":2013,"props":8316,"children":8317},{"style":2026},[8318],{"type":47,"value":2173},{"type":41,"tag":2013,"props":8320,"children":8321},{"style":2026},[8322],{"type":47,"value":2044},{"type":41,"tag":2013,"props":8324,"children":8325},{"style":2047},[8326],{"type":47,"value":2050},{"type":41,"tag":54,"props":8328,"children":8329},{},[8330],{"type":47,"value":8331},"If the failure was an out-of-band side-effect that left external systems half-changed, repair those by hand before re-applying.",{"type":41,"tag":203,"props":8333,"children":8335},{"id":8334},"workflow-recover-from-migrationhash_mismatch",[8336,8338],{"type":47,"value":8337},"Workflow — Recover from ",{"type":41,"tag":84,"props":8339,"children":8341},{"className":8340},[],[8342],{"type":47,"value":238},{"type":41,"tag":54,"props":8344,"children":8345},{},[8346,8347,8352,8354,8359,8361,8366,8368,8373],{"type":47,"value":2968},{"type":41,"tag":84,"props":8348,"children":8350},{"className":8349},[],[8351],{"type":47,"value":528},{"type":47,"value":8353}," is content-addressed. A mismatch means ",{"type":41,"tag":84,"props":8355,"children":8357},{"className":8356},[],[8358],{"type":47,"value":520},{"type":47,"value":8360},"'s stored hash disagrees with the hash recomputed from ",{"type":41,"tag":84,"props":8362,"children":8364},{"className":8363},[],[8365],{"type":47,"value":539},{"type":47,"value":8367}," (and metadata). The cause is almost always: someone edited ",{"type":41,"tag":84,"props":8369,"children":8371},{"className":8370},[],[8372],{"type":47,"value":115},{"type":47,"value":8374}," and forgot to self-emit. The remediation is to self-emit the offending package.",{"type":41,"tag":2002,"props":8376,"children":8377},{"className":2004,"code":8263,"language":2006,"meta":2007,"style":2007},[8378],{"type":41,"tag":84,"props":8379,"children":8380},{"__ignoreMap":2007},[8381,8412],{"type":41,"tag":2013,"props":8382,"children":8383},{"class":2015,"line":2016},[8384,8388,8392,8396,8400,8404,8408],{"type":41,"tag":2013,"props":8385,"children":8386},{"style":2020},[8387],{"type":47,"value":5631},{"type":41,"tag":2013,"props":8389,"children":8390},{"style":2026},[8391],{"type":47,"value":8279},{"type":41,"tag":2013,"props":8393,"children":8394},{"style":2075},[8395],{"type":47,"value":8284},{"type":41,"tag":2013,"props":8397,"children":8398},{"style":2026},[8399],{"type":47,"value":8289},{"type":41,"tag":2013,"props":8401,"children":8402},{"style":2047},[8403],{"type":47,"value":8294},{"type":41,"tag":2013,"props":8405,"children":8406},{"style":2075},[8407],{"type":47,"value":3661},{"type":41,"tag":2013,"props":8409,"children":8410},{"style":2026},[8411],{"type":47,"value":8303},{"type":41,"tag":2013,"props":8413,"children":8414},{"class":2015,"line":2053},[8415,8419,8423,8427,8431],{"type":41,"tag":2013,"props":8416,"children":8417},{"style":2020},[8418],{"type":47,"value":2023},{"type":41,"tag":2013,"props":8420,"children":8421},{"style":2026},[8422],{"type":47,"value":2029},{"type":41,"tag":2013,"props":8424,"children":8425},{"style":2026},[8426],{"type":47,"value":2173},{"type":41,"tag":2013,"props":8428,"children":8429},{"style":2026},[8430],{"type":47,"value":2044},{"type":41,"tag":2013,"props":8432,"children":8433},{"style":2047},[8434],{"type":47,"value":2050},{"type":41,"tag":54,"props":8436,"children":8437},{},[8438,8440,8445],{"type":47,"value":8439},"If self-emit itself fails (e.g. the contract has moved on and the operations no longer make sense against the migration's end contract), the package is stale. Either restore it from version control or delete it and re-plan with ",{"type":41,"tag":84,"props":8441,"children":8443},{"className":8442},[],[8444],{"type":47,"value":137},{"type":47,"value":276},{"type":41,"tag":203,"props":8447,"children":8449},{"id":8448},"workflow-resolve-a-destructive-operation-prompt-db-update-only",[8450,8452,8457],{"type":47,"value":8451},"Workflow — Resolve a destructive-operation prompt (",{"type":41,"tag":84,"props":8453,"children":8455},{"className":8454},[],[8456],{"type":47,"value":129},{"type":47,"value":8458}," only)",{"type":41,"tag":54,"props":8460,"children":8461},{},[8462,8464,8469,8471,8476,8478,8483,8485,8490,8492,8497,8499,8504],{"type":47,"value":8463},"The concept: when ",{"type":41,"tag":84,"props":8465,"children":8467},{"className":8466},[],[8468],{"type":47,"value":129},{"type":47,"value":8470}," would drop columns or tables, it stops and asks before applying. The prompt is ",{"type":41,"tag":84,"props":8472,"children":8474},{"className":8473},[],[8475],{"type":47,"value":129},{"type":47,"value":8477},"-specific — ",{"type":41,"tag":84,"props":8479,"children":8481},{"className":8480},[],[8482],{"type":47,"value":145},{"type":47,"value":8484}," does ",{"type":41,"tag":255,"props":8486,"children":8487},{},[8488],{"type":47,"value":8489},"not",{"type":47,"value":8491}," prompt and runs whatever the migration package contains, so review the plan or call ",{"type":41,"tag":84,"props":8493,"children":8495},{"className":8494},[],[8496],{"type":47,"value":3551},{"type":47,"value":8498}," before ",{"type":41,"tag":84,"props":8500,"children":8502},{"className":8501},[],[8503],{"type":47,"value":145},{"type":47,"value":276},{"type":41,"tag":54,"props":8506,"children":8507},{},[8508,8509,8514],{"type":47,"value":7752},{"type":41,"tag":84,"props":8510,"children":8512},{"className":8511},[],[8513],{"type":47,"value":129},{"type":47,"value":8515}," reports destructive operations interactively, the warning lists them. The prompt is:",{"type":41,"tag":50,"props":8517,"children":8518},{},[8519],{"type":41,"tag":54,"props":8520,"children":8521},{},[8522],{"type":47,"value":8523},"Apply destructive changes? This cannot be undone.",{"type":41,"tag":54,"props":8525,"children":8526},{},[8527],{"type":47,"value":8528},"Routing:",{"type":41,"tag":210,"props":8530,"children":8531},{},[8532,8537],{"type":41,"tag":73,"props":8533,"children":8534},{},[8535],{"type":47,"value":8536},"Answer yes if the data is no longer needed.",{"type":41,"tag":73,"props":8538,"children":8539},{},[8540,8542],{"type":47,"value":8541},"Answer no, then either:\n",{"type":41,"tag":210,"props":8543,"children":8544},{},[8545,8564],{"type":41,"tag":73,"props":8546,"children":8547},{},[8548,8550,8555,8557,8562],{"type":47,"value":8549},"Re-shape the migration via ",{"type":41,"tag":84,"props":8551,"children":8553},{"className":8552},[],[8554],{"type":47,"value":137},{"type":47,"value":8556}," and hand-edit ",{"type":41,"tag":84,"props":8558,"children":8560},{"className":8559},[],[8561],{"type":47,"value":115},{"type":47,"value":8563}," to preserve the data (e.g. copy-to-new-column, then drop), or",{"type":41,"tag":73,"props":8565,"children":8566},{},[8567],{"type":47,"value":8568},"Skip the destructive operation by reverting the contract change.",{"type":41,"tag":54,"props":8570,"children":8571},{},[8572,8574,8579,8580,8585,8587,8592,8594,8599],{"type":47,"value":8573},"In non-interactive contexts (CI, ",{"type":41,"tag":84,"props":8575,"children":8577},{"className":8576},[],[8578],{"type":47,"value":3003},{"type":47,"value":240},{"type":41,"tag":84,"props":8581,"children":8583},{"className":8582},[],[8584],{"type":47,"value":7588},{"type":47,"value":8586},"), the destructive-op response is returned as a structured error — ",{"type":41,"tag":84,"props":8588,"children":8590},{"className":8589},[],[8591],{"type":47,"value":3250},{"type":47,"value":8593}," lists what would have been dropped. Re-run with ",{"type":41,"tag":84,"props":8595,"children":8597},{"className":8596},[],[8598],{"type":47,"value":365},{"type":47,"value":8600}," to auto-accept, or address each operation individually.",{"type":41,"tag":203,"props":8602,"children":8604},{"id":8603},"common-pitfalls",[8605],{"type":47,"value":8606},"Common Pitfalls",{"type":41,"tag":69,"props":8608,"children":8609},{},[8610,8639,8676,8700,8737,8779,8823,8855,8901],{"type":41,"tag":73,"props":8611,"children":8612},{},[8613,8625,8627,8632,8633,8638],{"type":41,"tag":58,"props":8614,"children":8615},{},[8616,8618,8623],{"type":47,"value":8617},"Using ",{"type":41,"tag":84,"props":8619,"children":8621},{"className":8620},[],[8622],{"type":47,"value":129},{"type":47,"value":8624}," against shared or production databases.",{"type":47,"value":8626}," Never. The change leaves no migration history. Use ",{"type":41,"tag":84,"props":8628,"children":8630},{"className":8629},[],[8631],{"type":47,"value":137},{"type":47,"value":139},{"type":41,"tag":84,"props":8634,"children":8636},{"className":8635},[],[8637],{"type":47,"value":145},{"type":47,"value":276},{"type":41,"tag":73,"props":8640,"children":8641},{},[8642,8647,8649,8654,8655,8660,8662,8667,8669,8674],{"type":41,"tag":58,"props":8643,"children":8644},{},[8645],{"type":47,"value":8646},"Skipping a data transform.",{"type":47,"value":8648}," Leaving ",{"type":41,"tag":84,"props":8650,"children":8652},{"className":8651},[],[8653],{"type":47,"value":425},{"type":47,"value":5655},{"type":41,"tag":84,"props":8656,"children":8658},{"className":8657},[],[8659],{"type":47,"value":115},{"type":47,"value":8661}," makes the next ",{"type":41,"tag":84,"props":8663,"children":8665},{"className":8664},[],[8666],{"type":47,"value":145},{"type":47,"value":8668}," throw ",{"type":41,"tag":84,"props":8670,"children":8672},{"className":8671},[],[8673],{"type":47,"value":246},{"type":47,"value":8675},". Fill every placeholder slot and self-emit.",{"type":41,"tag":73,"props":8677,"children":8678},{},[8679,8691,8693,8698],{"type":41,"tag":58,"props":8680,"children":8681},{},[8682,8684,8689],{"type":47,"value":8683},"Editing ",{"type":41,"tag":84,"props":8685,"children":8687},{"className":8686},[],[8688],{"type":47,"value":539},{"type":47,"value":8690}," directly.",{"type":47,"value":8692}," It's the canonical artifact, not the authoring source. Edit ",{"type":41,"tag":84,"props":8694,"children":8696},{"className":8695},[],[8697],{"type":47,"value":115},{"type":47,"value":8699},", then self-emit.",{"type":41,"tag":73,"props":8701,"children":8702},{},[8703,8714,8716,8721,8723,8728,8730,8735],{"type":41,"tag":58,"props":8704,"children":8705},{},[8706,8708,8713],{"type":47,"value":8707},"Forgetting to self-emit after editing ",{"type":41,"tag":84,"props":8709,"children":8711},{"className":8710},[],[8712],{"type":47,"value":115},{"type":47,"value":276},{"type":47,"value":8715}," The next ",{"type":41,"tag":84,"props":8717,"children":8719},{"className":8718},[],[8720],{"type":47,"value":145},{"type":47,"value":8722}," either uses the stale ",{"type":41,"tag":84,"props":8724,"children":8726},{"className":8725},[],[8727],{"type":47,"value":539},{"type":47,"value":8729}," (if you only added comments) or fails with ",{"type":41,"tag":84,"props":8731,"children":8733},{"className":8732},[],[8734],{"type":47,"value":238},{"type":47,"value":8736}," (if you changed operations). Always self-emit.",{"type":41,"tag":73,"props":8738,"children":8739},{},[8740,8764,8766,8771,8773,8778],{"type":41,"tag":58,"props":8741,"children":8742},{},[8743,8745,8750,8752,8757,8758,8763],{"type":47,"value":8744},"Routine ",{"type":41,"tag":84,"props":8746,"children":8748},{"className":8747},[],[8749],{"type":47,"value":1076},{"type":47,"value":8751}," after a successful ",{"type":41,"tag":84,"props":8753,"children":8755},{"className":8754},[],[8756],{"type":47,"value":129},{"type":47,"value":2997},{"type":41,"tag":84,"props":8759,"children":8761},{"className":8760},[],[8762],{"type":47,"value":145},{"type":47,"value":276},{"type":47,"value":8765}," Redundant on the happy path — reserve ",{"type":41,"tag":84,"props":8767,"children":8769},{"className":8768},[],[8770],{"type":47,"value":1076},{"type":47,"value":8772}," for drift diagnosis (manual edits, restore, failed ",{"type":41,"tag":84,"props":8774,"children":8776},{"className":8775},[],[8777],{"type":47,"value":145},{"type":47,"value":530},{"type":41,"tag":73,"props":8780,"children":8781},{},[8782,8801,8803,8808,8809,8814,8816,8822],{"type":41,"tag":58,"props":8783,"children":8784},{},[8785,8787,8792,8794,8800],{"type":47,"value":8786},"Aggregate ",{"type":41,"tag":84,"props":8788,"children":8790},{"className":8789},[],[8791],{"type":47,"value":823},{"type":47,"value":8793}," closure in Postgres ",{"type":41,"tag":84,"props":8795,"children":8797},{"className":8796},[],[8798],{"type":47,"value":8799},"this.dataTransform",{"type":47,"value":276},{"type":47,"value":8802}," Returning ",{"type":41,"tag":84,"props":8804,"children":8806},{"className":8805},[],[8807],{"type":47,"value":4574},{"type":47,"value":2997},{"type":41,"tag":84,"props":8810,"children":8812},{"className":8811},[],[8813],{"type":47,"value":4581},{"type":47,"value":8815}," breaks the precheck\u002Fpostcheck contract — both sides resolve to constants. Use a rowset shape: ",{"type":41,"tag":84,"props":8817,"children":8819},{"className":8818},[],[8820],{"type":47,"value":8821},"select('id').where(\u003Cviolation>).limit(1)",{"type":47,"value":276},{"type":41,"tag":73,"props":8824,"children":8825},{},[8826,8831,8833,8839,8841,8846,8848,8853],{"type":41,"tag":58,"props":8827,"children":8828},{},[8829],{"type":47,"value":8830},"Two contract references in one migration.",{"type":47,"value":8832}," Building a query plan against a different contract than the one passed to ",{"type":41,"tag":84,"props":8834,"children":8836},{"className":8835},[],[8837],{"type":47,"value":8838},"this.dataTransform(endContract, ...)",{"type":47,"value":8840}," raises ",{"type":41,"tag":84,"props":8842,"children":8844},{"className":8843},[],[8845],{"type":47,"value":1576},{"type":47,"value":8847},". Always import ",{"type":41,"tag":84,"props":8849,"children":8851},{"className":8850},[],[8852],{"type":47,"value":839},{"type":47,"value":8854}," once at module scope and use the same reference.",{"type":41,"tag":73,"props":8856,"children":8857},{},[8858,8863,8865,8870,8872,8878,8880,8886,8888,8893,8895,8900],{"type":41,"tag":58,"props":8859,"children":8860},{},[8861],{"type":47,"value":8862},"Renaming and expecting the planner to detect it (Postgres).",{"type":47,"value":8864}," Prisma Next has no in-contract rename hint today; the planner emits a destructive drop+add. Hand-edit ",{"type":41,"tag":84,"props":8866,"children":8868},{"className":8867},[],[8869],{"type":47,"value":115},{"type":47,"value":8871}," to rewrite the destructive op as a ",{"type":41,"tag":84,"props":8873,"children":8875},{"className":8874},[],[8876],{"type":47,"value":8877},"rawSql({ ... })",{"type":47,"value":8879}," that issues ",{"type":41,"tag":84,"props":8881,"children":8883},{"className":8882},[],[8884],{"type":47,"value":8885},"ALTER TABLE ... RENAME COLUMN ...",{"type":47,"value":8887}," (or use the two-migration keep \u002F backfill \u002F drop pattern), then self-emit. See ",{"type":41,"tag":84,"props":8889,"children":8891},{"className":8890},[],[8892],{"type":47,"value":89},{"type":47,"value":8894}," § ",{"type":41,"tag":255,"props":8896,"children":8897},{},[8898],{"type":47,"value":8899},"Edit a field — rename",{"type":47,"value":276},{"type":41,"tag":73,"props":8902,"children":8903},{},[8904,8916,8918,8923,8924,8929,8931,8936,8937,8942,8944,8949,8950,8955],{"type":41,"tag":58,"props":8905,"children":8906},{},[8907,8909,8914],{"type":47,"value":8908},"Hand-authoring ",{"type":41,"tag":84,"props":8910,"children":8912},{"className":8911},[],[8913],{"type":47,"value":115},{"type":47,"value":8915}," from a blank file, or rewriting the rendered import line.",{"type":47,"value":8917}," Migration files are framework-rendered — let ",{"type":41,"tag":84,"props":8919,"children":8921},{"className":8920},[],[8922],{"type":47,"value":1200},{"type":47,"value":572},{"type":41,"tag":84,"props":8925,"children":8927},{"className":8926},[],[8928],{"type":47,"value":578},{"type":47,"value":8930},") render the package, then edit only the holes the framework leaves for you. On Postgres leave the rendered ",{"type":41,"tag":84,"props":8932,"children":8934},{"className":8933},[],[8935],{"type":47,"value":706},{"type":47,"value":572},{"type":41,"tag":84,"props":8938,"children":8940},{"className":8939},[],[8941],{"type":47,"value":1246},{"type":47,"value":8943},") import path alone; on Mongo use ",{"type":41,"tag":84,"props":8945,"children":8947},{"className":8946},[],[8948],{"type":47,"value":698},{"type":47,"value":139},{"type":41,"tag":84,"props":8951,"children":8953},{"className":8952},[],[8954],{"type":47,"value":1277},{"type":47,"value":8956}," as rendered. Add symbols to the existing factory import line rather than introducing new import paths.",{"type":41,"tag":203,"props":8958,"children":8960},{"id":8959},"what-prisma-next-doesnt-do-yet",[8961],{"type":47,"value":8962},"What Prisma Next doesn't do yet",{"type":41,"tag":210,"props":8964,"children":8965},{},[8966,8992,9031,9047],{"type":41,"tag":73,"props":8967,"children":8968},{},[8969,8974,8976,8982,8984,8990],{"type":41,"tag":58,"props":8970,"children":8971},{},[8972],{"type":47,"value":8973},"Runtime-apply migrations.",{"type":47,"value":8975}," Prisma Next doesn't apply pending migrations from your app's startup code (the \"Drizzle pattern\" for serverless \u002F edge). Workaround: run ",{"type":41,"tag":84,"props":8977,"children":8979},{"className":8978},[],[8980],{"type":47,"value":8981},"prisma-next migrate",{"type":47,"value":8983}," from your deploy pipeline before the app starts. If you need runtime-apply built-in, file a feature request via the ",{"type":41,"tag":84,"props":8985,"children":8987},{"className":8986},[],[8988],{"type":47,"value":8989},"prisma-next-feedback",{"type":47,"value":8991}," skill.",{"type":41,"tag":73,"props":8993,"children":8994},{},[8995,9000,9002,9008,9010,9015,9017,9023,9025,9030],{"type":41,"tag":58,"props":8996,"children":8997},{},[8998],{"type":47,"value":8999},"Seeds-as-first-class.",{"type":47,"value":9001}," Prisma Next doesn't ship a ",{"type":41,"tag":84,"props":9003,"children":9005},{"className":9004},[],[9006],{"type":47,"value":9007},"prisma db seed",{"type":47,"value":9009}," equivalent. Workaround: write a TypeScript script that imports your ",{"type":41,"tag":84,"props":9011,"children":9013},{"className":9012},[],[9014],{"type":47,"value":1986},{"type":47,"value":9016}," instance and runs your setup queries; invoke it from ",{"type":41,"tag":84,"props":9018,"children":9020},{"className":9019},[],[9021],{"type":47,"value":9022},"package.json",{"type":47,"value":9024},"'s scripts. If you need first-class seeding, file a feature request via the ",{"type":41,"tag":84,"props":9026,"children":9028},{"className":9027},[],[9029],{"type":47,"value":8989},{"type":47,"value":8991},{"type":41,"tag":73,"props":9032,"children":9033},{},[9034,9039,9041,9046],{"type":41,"tag":58,"props":9035,"children":9036},{},[9037],{"type":47,"value":9038},"Migration squashing.",{"type":47,"value":9040}," Prisma Next doesn't squash older migrations into a baseline. They accumulate; for very large histories, manual baseline-and-truncate is the path. If you need built-in squashing, file a feature request via the ",{"type":41,"tag":84,"props":9042,"children":9044},{"className":9043},[],[9045],{"type":47,"value":8989},{"type":47,"value":8991},{"type":41,"tag":73,"props":9048,"children":9049},{},[9050,9055,9057,9062,9064,9070,9072,9077,9079,9084],{"type":41,"tag":58,"props":9051,"children":9052},{},[9053],{"type":47,"value":9054},"In-contract rename hints.",{"type":47,"value":9056}," The planner cannot detect that a field rename is a rename rather than a drop+add. Workaround: hand-edit ",{"type":41,"tag":84,"props":9058,"children":9060},{"className":9059},[],[9061],{"type":47,"value":115},{"type":47,"value":9063}," to issue a ",{"type":41,"tag":84,"props":9065,"children":9067},{"className":9066},[],[9068],{"type":47,"value":9069},"RENAME COLUMN",{"type":47,"value":9071}," via ",{"type":41,"tag":84,"props":9073,"children":9075},{"className":9074},[],[9076],{"type":47,"value":8166},{"type":47,"value":9078},", or use a keep \u002F backfill \u002F drop pattern across two migrations. If you need a contract-level rename hint, file a feature request via the ",{"type":41,"tag":84,"props":9080,"children":9082},{"className":9081},[],[9083],{"type":47,"value":8989},{"type":47,"value":8991},{"type":41,"tag":203,"props":9086,"children":9088},{"id":9087},"graph-and-history-commands",[9089],{"type":47,"value":9090},"Graph and history commands",{"type":41,"tag":54,"props":9092,"children":9093},{},[9094],{"type":47,"value":9095},"After planning or applying, you can inspect the migration graph offline:",{"type":41,"tag":210,"props":9097,"children":9098},{},[9099,9132],{"type":41,"tag":73,"props":9100,"children":9101},{},[9102,9108,9110,9116,9118,9124,9126,9131],{"type":41,"tag":84,"props":9103,"children":9105},{"className":9104},[],[9106],{"type":47,"value":9107},"pnpm prisma-next migration list",{"type":47,"value":9109}," — enumerate all on-disk migrations, rendered as a graph tree. Supports ",{"type":41,"tag":84,"props":9111,"children":9113},{"className":9112},[],[9114],{"type":47,"value":9115},"--legend",{"type":47,"value":9117}," (print the glyph key), ",{"type":41,"tag":84,"props":9119,"children":9121},{"className":9120},[],[9122],{"type":47,"value":9123},"--ascii",{"type":47,"value":9125}," (pipe-safe glyphs), and ",{"type":41,"tag":84,"props":9127,"children":9129},{"className":9128},[],[9130],{"type":47,"value":7588},{"type":47,"value":276},{"type":41,"tag":73,"props":9133,"children":9134},{},[9135,9141,9143,9148,9149,9154],{"type":41,"tag":84,"props":9136,"children":9138},{"className":9137},[],[9139],{"type":47,"value":9140},"pnpm prisma-next migration log --db $DATABASE_URL",{"type":47,"value":9142}," — flat chronological table of applied migrations, read from the live DB. Supports ",{"type":41,"tag":84,"props":9144,"children":9146},{"className":9145},[],[9147],{"type":47,"value":9123},{"type":47,"value":131},{"type":41,"tag":84,"props":9150,"children":9152},{"className":9151},[],[9153],{"type":47,"value":7588},{"type":47,"value":276},{"type":41,"tag":54,"props":9156,"children":9157},{},[9158,9160,9166,9168,9173,9174,9179,9180,9186,9187,9192],{"type":47,"value":9159},"For the full graph topology: ",{"type":41,"tag":84,"props":9161,"children":9163},{"className":9162},[],[9164],{"type":47,"value":9165},"pnpm prisma-next migration graph",{"type":47,"value":9167}," (also supports ",{"type":41,"tag":84,"props":9169,"children":9171},{"className":9170},[],[9172],{"type":47,"value":9115},{"type":47,"value":240},{"type":41,"tag":84,"props":9175,"children":9177},{"className":9176},[],[9178],{"type":47,"value":9123},{"type":47,"value":240},{"type":41,"tag":84,"props":9181,"children":9183},{"className":9182},[],[9184],{"type":47,"value":9185},"--dot",{"type":47,"value":240},{"type":41,"tag":84,"props":9188,"children":9190},{"className":9189},[],[9191],{"type":47,"value":7588},{"type":47,"value":530},{"type":41,"tag":203,"props":9194,"children":9196},{"id":9195},"control-and-ddl-scope",[9197,9203],{"type":41,"tag":84,"props":9198,"children":9200},{"className":9199},[],[9201],{"type":47,"value":9202},"@@control",{"type":47,"value":9204}," and DDL scope",{"type":41,"tag":54,"props":9206,"children":9207},{},[9208,9210,9215,9217,9223,9225,9231,9233,9239,9241,9247,9249,9255,9257,9262,9263,9273],{"type":47,"value":9209},"Objects whose ",{"type":41,"tag":84,"props":9211,"children":9213},{"className":9212},[],[9214],{"type":47,"value":9202},{"type":47,"value":9216}," policy excludes them from Prisma Next's managed surface are omitted from planned DDL. The four policies are: ",{"type":41,"tag":84,"props":9218,"children":9220},{"className":9219},[],[9221],{"type":47,"value":9222},"managed",{"type":47,"value":9224}," (Prisma plans and applies DDL), ",{"type":41,"tag":84,"props":9226,"children":9228},{"className":9227},[],[9229],{"type":47,"value":9230},"tolerated",{"type":47,"value":9232}," (object may exist, no DDL emitted), ",{"type":41,"tag":84,"props":9234,"children":9236},{"className":9235},[],[9237],{"type":47,"value":9238},"external",{"type":47,"value":9240}," (object is expected to exist, no DDL), ",{"type":41,"tag":84,"props":9242,"children":9244},{"className":9243},[],[9245],{"type":47,"value":9246},"observed",{"type":47,"value":9248}," (Prisma reads but never writes). Declare ",{"type":41,"tag":84,"props":9250,"children":9252},{"className":9251},[],[9253],{"type":47,"value":9254},"@@control(managed|tolerated|external|observed)",{"type":47,"value":9256}," in your schema; see ",{"type":41,"tag":84,"props":9258,"children":9260},{"className":9259},[],[9261],{"type":47,"value":89},{"type":47,"value":131},{"type":41,"tag":2910,"props":9264,"children":9266},{"href":9265},"..\u002F..\u002Fpackages\u002F2-sql\u002F2-authoring\u002Fcontract-psl\u002FREADME.md",[9267],{"type":41,"tag":84,"props":9268,"children":9270},{"className":9269},[],[9271],{"type":47,"value":9272},"packages\u002F2-sql\u002F2-authoring\u002Fcontract-psl\u002FREADME.md",{"type":47,"value":9274}," for authoring syntax.",{"type":41,"tag":203,"props":9276,"children":9278},{"id":9277},"telemetry",[9279],{"type":47,"value":9280},"Telemetry",{"type":41,"tag":54,"props":9282,"children":9283},{},[9284,9286,9292,9293,9299,9301,9311],{"type":47,"value":9285},"The CLI collects anonymous usage data by default. To opt out, set ",{"type":41,"tag":84,"props":9287,"children":9289},{"className":9288},[],[9290],{"type":47,"value":9291},"PRISMA_NEXT_DISABLE_TELEMETRY=1",{"type":47,"value":2997},{"type":41,"tag":84,"props":9294,"children":9296},{"className":9295},[],[9297],{"type":47,"value":9298},"DO_NOT_TRACK=1",{"type":47,"value":9300}," in your environment. See ",{"type":41,"tag":2910,"props":9302,"children":9304},{"href":9303},"..\u002F..\u002Fdocs\u002FTelemetry.md",[9305],{"type":41,"tag":84,"props":9306,"children":9308},{"className":9307},[],[9309],{"type":47,"value":9310},"docs\u002FTelemetry.md",{"type":47,"value":9312}," for the full opt-out reference.",{"type":41,"tag":203,"props":9314,"children":9316},{"id":9315},"checklist",[9317],{"type":47,"value":9318},"Checklist",{"type":41,"tag":210,"props":9320,"children":9323},{"className":9321},[9322],"contains-task-list",[9324,9350,9379,9408,9436,9451,9467,9489,9505,9521,9536],{"type":41,"tag":73,"props":9325,"children":9328},{"className":9326},[9327],"task-list-item",[9329,9334,9336,9342,9343,9348],{"type":41,"tag":9330,"props":9331,"children":9333},"input",{"disabled":2581,"type":9332},"checkbox",[],{"type":47,"value":9335}," Contract emitted (",{"type":41,"tag":84,"props":9337,"children":9339},{"className":9338},[],[9340],{"type":47,"value":9341},"contract.json",{"type":47,"value":139},{"type":41,"tag":84,"props":9344,"children":9346},{"className":9345},[],[9347],{"type":47,"value":630},{"type":47,"value":9349}," current).",{"type":41,"tag":73,"props":9351,"children":9353},{"className":9352},[9327],[9354,9357,9359,9364,9366,9371,9372,9377],{"type":41,"tag":9330,"props":9355,"children":9356},{"disabled":2581,"type":9332},[],{"type":47,"value":9358}," Chose the right path: ",{"type":41,"tag":84,"props":9360,"children":9362},{"className":9361},[],[9363],{"type":47,"value":129},{"type":47,"value":9365}," (local dev) vs ",{"type":41,"tag":84,"props":9367,"children":9369},{"className":9368},[],[9370],{"type":47,"value":137},{"type":47,"value":139},{"type":41,"tag":84,"props":9373,"children":9375},{"className":9374},[],[9376],{"type":47,"value":145},{"type":47,"value":9378}," (anything shared).",{"type":41,"tag":73,"props":9380,"children":9382},{"className":9381},[9327],[9383,9386,9388,9393,9395,9400,9402,9407],{"type":41,"tag":9330,"props":9384,"children":9385},{"disabled":2581,"type":9332},[],{"type":47,"value":9387}," For ",{"type":41,"tag":84,"props":9389,"children":9391},{"className":9390},[],[9392],{"type":47,"value":137},{"type":47,"value":9394},": ran ",{"type":41,"tag":84,"props":9396,"children":9398},{"className":9397},[],[9399],{"type":47,"value":3551},{"type":47,"value":9401}," to review before ",{"type":41,"tag":84,"props":9403,"children":9405},{"className":9404},[],[9406],{"type":47,"value":145},{"type":47,"value":276},{"type":41,"tag":73,"props":9409,"children":9411},{"className":9410},[9327],[9412,9415,9417,9422,9423,9428,9430,9435],{"type":41,"tag":9330,"props":9413,"children":9414},{"disabled":2581,"type":9332},[],{"type":47,"value":9416}," Filled every ",{"type":41,"tag":84,"props":9418,"children":9420},{"className":9419},[],[9421],{"type":47,"value":425},{"type":47,"value":5655},{"type":41,"tag":84,"props":9424,"children":9426},{"className":9425},[],[9427],{"type":47,"value":115},{"type":47,"value":9429}," (if any), built against ",{"type":41,"tag":84,"props":9431,"children":9433},{"className":9432},[],[9434],{"type":47,"value":839},{"type":47,"value":276},{"type":41,"tag":73,"props":9437,"children":9439},{"className":9438},[9327],[9440,9443,9444,9449],{"type":41,"tag":9330,"props":9441,"children":9442},{"disabled":2581,"type":9332},[],{"type":47,"value":610},{"type":41,"tag":84,"props":9445,"children":9447},{"className":9446},[],[9448],{"type":47,"value":823},{"type":47,"value":9450}," closures are rowset queries, not scalar aggregates.",{"type":41,"tag":73,"props":9452,"children":9454},{"className":9453},[9327],[9455,9458,9460,9465],{"type":41,"tag":9330,"props":9456,"children":9457},{"disabled":2581,"type":9332},[],{"type":47,"value":9459}," Self-emitted (",{"type":41,"tag":84,"props":9461,"children":9463},{"className":9462},[],[9464],{"type":47,"value":655},{"type":47,"value":9466},") after editing the TS.",{"type":41,"tag":73,"props":9468,"children":9470},{"className":9469},[9327],[9471,9474,9476,9481,9482,9487],{"type":41,"tag":9330,"props":9472,"children":9473},{"disabled":2581,"type":9332},[],{"type":47,"value":9475}," Ran ",{"type":41,"tag":84,"props":9477,"children":9479},{"className":9478},[],[9480],{"type":47,"value":145},{"type":47,"value":572},{"type":41,"tag":84,"props":9483,"children":9485},{"className":9484},[],[9486],{"type":47,"value":129},{"type":47,"value":9488},") and saw it complete.",{"type":41,"tag":73,"props":9490,"children":9492},{"className":9491},[9327],[9493,9496,9498,9503],{"type":41,"tag":9330,"props":9494,"children":9495},{"disabled":2581,"type":9332},[],{"type":47,"value":9497}," Used ",{"type":41,"tag":84,"props":9499,"children":9501},{"className":9500},[],[9502],{"type":47,"value":1076},{"type":47,"value":9504}," only when diagnosing drift — not as a routine post-apply step.",{"type":41,"tag":73,"props":9506,"children":9508},{"className":9507},[9327],[9509,9512,9514,9519],{"type":41,"tag":9330,"props":9510,"children":9511},{"disabled":2581,"type":9332},[],{"type":47,"value":9513}," Did NOT use ",{"type":41,"tag":84,"props":9515,"children":9517},{"className":9516},[],[9518],{"type":47,"value":129},{"type":47,"value":9520}," against a shared or production database.",{"type":41,"tag":73,"props":9522,"children":9524},{"className":9523},[9327],[9525,9528,9530,9535],{"type":41,"tag":9330,"props":9526,"children":9527},{"disabled":2581,"type":9332},[],{"type":47,"value":9529}," Did NOT edit ",{"type":41,"tag":84,"props":9531,"children":9533},{"className":9532},[],[9534],{"type":47,"value":539},{"type":47,"value":8690},{"type":41,"tag":73,"props":9537,"children":9539},{"className":9538},[9327],[9540,9543,9545,9550],{"type":41,"tag":9330,"props":9541,"children":9542},{"disabled":2581,"type":9332},[],{"type":47,"value":9544}," Did NOT skip a destructive-op prompt without inspecting ",{"type":41,"tag":84,"props":9546,"children":9548},{"className":9547},[],[9549],{"type":47,"value":3250},{"type":47,"value":276},{"type":41,"tag":9552,"props":9553,"children":9554},"style",{},[9555],{"type":47,"value":9556},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"items":9558,"total":4210},[9559,9572,9587,9599,9611,9624,9639],{"slug":9560,"name":9560,"fn":9561,"description":9562,"org":9563,"tags":9564,"stars":23,"repoUrl":24,"updatedAt":9571},"prisma-next","guide Prisma Next project setup and usage","Route a vague Prisma Next prompt to the right specific skill. Use for \"help me with Prisma Next\", \"what is Prisma Next\", \"explain Prisma Next\", \"I'm new to PN\", \"where do I start\", \"what can I do with Prisma Next\", \"what can I do next with Prisma\", \"just ran createprisma\", \"tour of Prisma Next\", \"Prisma Next overview\", and comparison questions like \"Prisma Next vs Prisma 7\", \"PN vs Drizzle\", \"PN vs Kysely\", \"PN vs TypeORM\". Do NOT use when the prompt clearly matches a workflow skill — adoption \u002F quickstart \u002F first-touch orientation \u002F brownfield introspection, schema \u002F contract editing, migration authoring (db update \u002F migration plan \u002F migrate), migration review on deploy \u002F concurrent migrations, queries \u002F db.orm \u002F db.sql \u002F TypedSQL, Supabase \u002F RLS \u002F role binding, runtime \u002F db.ts \u002F middleware wiring, build \u002F Vite plugin \u002F Next.js plugin, debug \u002F structured error envelopes \u002F PN-* error codes, or feedback \u002F bug report \u002F feature request — load that sibling skill directly.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[9565,9566,9569,9570],{"name":17,"slug":18,"type":15},{"name":9567,"slug":9568,"type":15},"Next.js","next-js",{"name":9,"slug":8,"type":15},{"name":13,"slug":14,"type":15},"2026-07-17T05:32:04.322957",{"slug":9573,"name":9573,"fn":9574,"description":9575,"org":9576,"tags":9577,"stars":23,"repoUrl":24,"updatedAt":9586},"prisma-next-build","integrate Prisma Next into build systems","Wire Prisma Next into the project's build system with the right build-tool plugin — Vite today via @prisma-next\u002Fvite-plugin-contract-emit (Vite 7 \u002F 8); Next.js \u002F Webpack \u002F esbuild \u002F Rollup \u002F Turbopack are named as gaps rather than fabricated. Always offers the Vite plugin proactively when the project is using Vite. Use for vite plugin, vite-plugin, vite.config.ts, prismaVitePlugin, contract emit on save, HMR, hot reload contract, dev server, Next.js plugin, next plugin, withPrismaNext, webpack plugin, esbuild plugin, rollup plugin, build integration, dev server plugin, vite 7, vite 8.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[9578,9581,9582,9583],{"name":9579,"slug":9580,"type":15},"Deployment","deployment",{"name":9567,"slug":9568,"type":15},{"name":9,"slug":8,"type":15},{"name":9584,"slug":9585,"type":15},"Vite","vite","2026-07-02T07:31:36.108254",{"slug":89,"name":89,"fn":9588,"description":9589,"org":9590,"tags":9591,"stars":23,"repoUrl":24,"updatedAt":9598},"edit Prisma Next data contracts and models","Edit the Prisma Next data contract — add models, fields, relations, indexes, enums, value objects (composite types), type aliases, namespaces (Postgres schemas), cross-contract foreign keys (cross-space FK), polymorphic types (`@@discriminator` \u002F `@@base`), use extension namespaces (`pgvector.Vector(...)`, `cipherstash.EncryptedString(...)`), wire `prisma-next.config.ts` with `defineConfig` from the `@prisma-next\u002F\u003Ctarget>\u002Fconfig` façade, and run `prisma-next contract emit`. Use for schema, models, fields, attributes, soft delete, paranoid, scopes, validations, callbacks, prisma schema, PSL, contract.prisma, contract.ts, contract.json, contract.d.ts, `@prisma-next\u002Fpostgres\u002Fconfig`, `@prisma-next\u002Fpostgres\u002Fcontract-builder`, `@prisma-next\u002Fpostgres\u002Fcontrol`, `@prisma-next\u002Fmongo\u002Fconfig`, `@prisma-next\u002Fmongo\u002Fcontract-builder`, `extensions:`, pgvector, cipherstash, postgis, paradedb, supabase, `@prisma-next\u002Fextension-supabase`, `@@control`, control policy, managed, tolerated, external, observed.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[9592,9595,9596,9597],{"name":9593,"slug":9594,"type":15},"Data Modeling","data-modeling",{"name":17,"slug":18,"type":15},{"name":9,"slug":8,"type":15},{"name":13,"slug":14,"type":15},"2026-07-30T05:30:10.426962",{"slug":326,"name":326,"fn":9600,"description":9601,"org":9602,"tags":9603,"stars":23,"repoUrl":24,"updatedAt":9610},"debug and recover from Prisma Next errors","Read a Prisma Next structured error envelope and route to the right recovery — code, domain, severity, why, fix, meta. Use for error, exception, my emit failed, my query won't typecheck, my query crashed, my migration won't apply, MIGRATION.HASH_MISMATCH, BUDGET.ROWS_EXCEEDED, BUDGET.TIME_EXCEEDED, RUNTIME.ABORTED, PLAN.HASH_MISMATCH, CONTRACT.MARKER_MISSING, PN-RUN-3001, PN-RUN-3002, PN-RUN-3030, PN-MIG-2001, PN-CLI-4011, PN-SCHEMA-0001, drift, capability missing, planner conflict, prisma studio, EXPLAIN, query log, db.end, db.close, script won't exit, hangs, close connection, pool.end, client is closed.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[9604,9605,9608,9609],{"name":17,"slug":18,"type":15},{"name":9606,"slug":9607,"type":15},"Debugging","debugging",{"name":9567,"slug":9568,"type":15},{"name":9,"slug":8,"type":15},"2026-07-24T05:37:10.436314",{"slug":8989,"name":8989,"fn":9612,"description":9613,"org":9614,"tags":9615,"stars":23,"repoUrl":24,"updatedAt":9623},"report Prisma Next issues and feedback","Hand a Prisma Next question or report off to the team — file a GitHub issue (bug or feature request), or route Q&A \u002F design discussion \u002F direct-team-contact to the Prisma Discord at pris.ly\u002Fdiscord. Use for bug, bug report, file an issue, report a bug, feature request, missing feature, this should be a feature, file this, this is a bug, this is broken, surprising behaviour, this doesn't work, file feedback, send feedback, capability gap, file via prisma-next-feedback, ask the team, talk to the team, talk to the Prisma team, talk to Prisma, Discord, Prisma Discord, Q&A, design feedback, is this the intended way, how should I do X, extension author question, extension author needs help.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[9616,9619,9622],{"name":9617,"slug":9618,"type":15},"Documentation","documentation",{"name":9620,"slug":9621,"type":15},"GitHub","github",{"name":9,"slug":8,"type":15},"2026-07-02T07:31:34.870809",{"slug":303,"name":303,"fn":9625,"description":9626,"org":9627,"tags":9628,"stars":23,"repoUrl":24,"updatedAt":9638},"review and resolve Prisma Next migrations","Review what Prisma Next migrations will run on merge or deploy, render the migration graph, resolve concurrent \u002F diamond-convergence conflicts, and configure environment refs for CI. Use for \"what migrations are going to run\", \"what runs on deploy\", merge conflict, diamond convergence, concurrent migrations, migration status, ref management, staging, production, MIGRATION.DIVERGED, MIGRATION.NO_MARKER, MIGRATION.MARKER_NOT_IN_HISTORY, prisma migrate status, prisma migrate diff, prisma migrate resolve.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[9629,9632,9635,9636,9637],{"name":9630,"slug":9631,"type":15},"CI\u002FCD","ci-cd",{"name":9633,"slug":9634,"type":15},"Code Review","code-review",{"name":17,"slug":18,"type":15},{"name":20,"slug":21,"type":15},{"name":9,"slug":8,"type":15},"2026-07-24T05:37:11.422323",{"slug":4,"name":4,"fn":5,"description":6,"org":9640,"tags":9641,"stars":23,"repoUrl":24,"updatedAt":25},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[9642,9643,9644,9645],{"name":17,"slug":18,"type":15},{"name":20,"slug":21,"type":15},{"name":9,"slug":8,"type":15},{"name":13,"slug":14,"type":15},{"items":9647,"total":4467},[9648,9655,9662,9669,9676,9682,9690,9697,9712,9725,9736,9752],{"slug":9560,"name":9560,"fn":9561,"description":9562,"org":9649,"tags":9650,"stars":23,"repoUrl":24,"updatedAt":9571},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[9651,9652,9653,9654],{"name":17,"slug":18,"type":15},{"name":9567,"slug":9568,"type":15},{"name":9,"slug":8,"type":15},{"name":13,"slug":14,"type":15},{"slug":9573,"name":9573,"fn":9574,"description":9575,"org":9656,"tags":9657,"stars":23,"repoUrl":24,"updatedAt":9586},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[9658,9659,9660,9661],{"name":9579,"slug":9580,"type":15},{"name":9567,"slug":9568,"type":15},{"name":9,"slug":8,"type":15},{"name":9584,"slug":9585,"type":15},{"slug":89,"name":89,"fn":9588,"description":9589,"org":9663,"tags":9664,"stars":23,"repoUrl":24,"updatedAt":9598},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[9665,9666,9667,9668],{"name":9593,"slug":9594,"type":15},{"name":17,"slug":18,"type":15},{"name":9,"slug":8,"type":15},{"name":13,"slug":14,"type":15},{"slug":326,"name":326,"fn":9600,"description":9601,"org":9670,"tags":9671,"stars":23,"repoUrl":24,"updatedAt":9610},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[9672,9673,9674,9675],{"name":17,"slug":18,"type":15},{"name":9606,"slug":9607,"type":15},{"name":9567,"slug":9568,"type":15},{"name":9,"slug":8,"type":15},{"slug":8989,"name":8989,"fn":9612,"description":9613,"org":9677,"tags":9678,"stars":23,"repoUrl":24,"updatedAt":9623},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[9679,9680,9681],{"name":9617,"slug":9618,"type":15},{"name":9620,"slug":9621,"type":15},{"name":9,"slug":8,"type":15},{"slug":303,"name":303,"fn":9625,"description":9626,"org":9683,"tags":9684,"stars":23,"repoUrl":24,"updatedAt":9638},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[9685,9686,9687,9688,9689],{"name":9630,"slug":9631,"type":15},{"name":9633,"slug":9634,"type":15},{"name":17,"slug":18,"type":15},{"name":20,"slug":21,"type":15},{"name":9,"slug":8,"type":15},{"slug":4,"name":4,"fn":5,"description":6,"org":9691,"tags":9692,"stars":23,"repoUrl":24,"updatedAt":25},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[9693,9694,9695,9696],{"name":17,"slug":18,"type":15},{"name":20,"slug":21,"type":15},{"name":9,"slug":8,"type":15},{"name":13,"slug":14,"type":15},{"slug":4673,"name":4673,"fn":9698,"description":9699,"org":9700,"tags":9701,"stars":23,"repoUrl":24,"updatedAt":9711},"write Prisma Next queries for database operations","Write Prisma Next queries for Postgres, SQLite, or Mongo — pick a lane (Postgres\u002FSQLite `db.orm.\u003CModel>` + `db.sql.\u003Ctable>`; Mongo `db.orm.\u003Croot>` + `db.query.from(...)` pipeline builder), filter \u002F project \u002F sort \u002F paginate, eager-load with `.include(...)`, Postgres\u002FSQLite `db.transaction(...)`, Postgres\u002FSQLite ORM `.aggregate(...)`, Mongo aggregations via query builder, namespace-aware accessors (`db.orm.\u003Cns>.\u003CModel>`, `db.sql.\u003Cns>.\u003Ctable>`). Triggers: query, where, match, select, project, orderBy, take, skip, include, lookup, first, all, count, aggregate, group, create, update, delete, upsert, returning, transaction, db.close, script teardown, variant, polymorphism, drizzle-style, kysely-style. Notes: `.all()` is a Thenable (just `await` it), iterators are single-use (`RUNTIME.ITERATOR_CONSUMED`), Postgres `count` is `number` while sum\u002Favg\u002Fmin\u002Fmax are `number | null`, ranges use chained `.where()` or `and(...)` (no `.between(...)`).",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[9702,9703,9704,9707,9708],{"name":17,"slug":18,"type":15},{"name":9567,"slug":9568,"type":15},{"name":9705,"slug":9706,"type":15},"PostgreSQL","postgresql",{"name":9,"slug":8,"type":15},{"name":9709,"slug":9710,"type":15},"SQL","sql","2026-07-17T05:32:03.35373",{"slug":9713,"name":9713,"fn":9714,"description":9715,"org":9716,"tags":9717,"stars":23,"repoUrl":24,"updatedAt":9724},"prisma-next-quickstart","adopt Prisma Next in projects","Adopt Prisma Next into a new project, onto an existing database, or as the first move after a bootstrap tool dropped you into a scaffold. Use for \"what can I do with Prisma Next\", \"what can I do next with Prisma\", \"where do I start\", \"what should I do first\", \"just ran createprisma\", \"createprisma\", \"npx createprisma\", \"npx create-prisma\", \"first steps\", \"first query\", \"I have a scaffolded Prisma Next project what now\"; for `pnpm dlx prisma-next init` greenfield setup; and for `prisma-next contract infer` + `db sign` against an existing database. Also covers the connect-write-read first-arc orientation, the day-to-day commands (`contract emit`, `db init`, `db update`, `migration plan`, `migrate`, `db schema`, `db verify`), and routing to `prisma-next-contract` \u002F `prisma-next-queries` \u002F `prisma-next-runtime` for the next move. Flags: --target, --authoring, --schema-path, --probe-db, --output.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[9718,9719,9722,9723],{"name":17,"slug":18,"type":15},{"name":9720,"slug":9721,"type":15},"ORM","orm",{"name":9,"slug":8,"type":15},{"name":13,"slug":14,"type":15},"2026-07-24T05:37:12.462072",{"slug":9726,"name":9726,"fn":9727,"description":9728,"org":9729,"tags":9730,"stars":23,"repoUrl":24,"updatedAt":9735},"prisma-next-runtime","configure Prisma Next runtime and database connections","Wire the Prisma Next runtime — `db.ts` setup using `postgres\u003CContract>(...)` from `@prisma-next\u002Fpostgres\u002Fruntime`, `sqlite\u003CContract>(...)` from `@prisma-next\u002Fsqlite\u002Fruntime`, or `mongo\u003CContract>(...)` from `@prisma-next\u002Fmongo\u002Fruntime`; middleware composition (telemetry from `@prisma-next\u002Fmiddleware-telemetry`; lints and budgets), `DATABASE_URL` config, per-environment branching, switching between Postgres, SQLite, and Mongo façades. Use for db.ts, postgres(), sqlite(), mongo(), middleware, telemetry, lints, budgets, DATABASE_URL, .env, connection pool, poolOptions, dev vs prod config, transactions, db.transaction, read replicas, multi-database, script won't exit, hangs, close connection, db.end, db.close, pool.end, [Symbol.asyncDispose], await using.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[9731,9732,9733,9734],{"name":17,"slug":18,"type":15},{"name":9567,"slug":9568,"type":15},{"name":9705,"slug":9706,"type":15},{"name":9,"slug":8,"type":15},"2026-07-17T05:32:05.347316",{"slug":9737,"name":9737,"fn":9738,"description":9739,"org":9740,"tags":9741,"stars":23,"repoUrl":24,"updatedAt":9751},"prisma-next-supabase","integrate Prisma with Supabase","Use Prisma Next with a Supabase project via `@prisma-next\u002Fextension-supabase` — wire `extensions: [supabasePack]`, declare cross-space FKs to `supabase:auth.AuthUser`, author RLS policies (`policy_select` \u002F `policy_update` \u002F `@@rls`, `auth.uid()` predicates), build `db.ts` with the `supabase()` factory, bind roles per request (`asUser(jwt)` \u002F `asAnon()` \u002F `asServiceRole()`), query `auth.*` \u002F `storage.*` via the `db.asServiceRole().supabase` admin root, and validate JWTs (`jwksUrl` for current projects \u002F `jwtSecret` for legacy HS256). Use for supabase, RLS, row level security, policy, role binding, anon, authenticated, service_role, auth.users, auth.uid(), JWT, JWKS, SUPABASE_JWKS_URL, SUPABASE_JWT_SECRET, SUPABASE.JWT_INVALID, SUPABASE.CONFIG_INVALID, RoleBoundDb, session pooler, supabase:auth.AuthUser, @prisma-next\u002Fextension-supabase.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[9742,9745,9746,9747,9748],{"name":9743,"slug":9744,"type":15},"Auth","auth",{"name":9720,"slug":9721,"type":15},{"name":9705,"slug":9706,"type":15},{"name":9,"slug":8,"type":15},{"name":9749,"slug":9750,"type":15},"Supabase","supabase","2026-07-30T05:30:11.065251",{"slug":9753,"name":9753,"fn":9754,"description":9755,"org":9756,"tags":9757,"stars":9765,"repoUrl":9766,"updatedAt":9767},"prisma-cli","run Prisma CLI commands","Prisma ORM CLI commands reference covering init, generate, migrate, db, dev, studio, validate, format, debug, and mcp. Use for ORM\u002Fdatabase CLI workflows, not Prisma Compute app deployment. For Prisma Compute, `@prisma\u002Fcli app deploy`, `compute:deploy`, `create-prisma --deploy`, apps, deployments, logs, or domains, use the `prisma-compute` skill instead. Triggers on \"prisma init\", \"prisma generate\", \"prisma migrate\", \"prisma db\", \"prisma studio\", \"prisma mcp\".",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[9758,9761,9762,9763,9764],{"name":9759,"slug":9760,"type":15},"CLI","cli",{"name":17,"slug":18,"type":15},{"name":20,"slug":21,"type":15},{"name":9720,"slug":9721,"type":15},{"name":9,"slug":8,"type":15},44,"https:\u002F\u002Fgithub.com\u002Fprisma\u002Fskills","2026-04-06T18:48:29.140467"]