@prisma/orm-sqlite 8.0.0-rc.11-dev.46 → 8.0.0-rc.11-dev.47

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/orm-sqlite",
3
- "version": "8.0.0-rc.11-dev.46",
3
+ "version": "8.0.0-rc.11-dev.47",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -10,16 +10,16 @@
10
10
  "skills"
11
11
  ],
12
12
  "dependencies": {
13
- "@prisma/orm-family-sql": "8.0.0-rc.11-dev.46",
14
- "@prisma/orm-framework": "8.0.0-rc.11-dev.46",
15
- "@prisma/orm-target-sqlite": "8.0.0-rc.11-dev.46",
16
- "@prisma/orm-toolchain": "8.0.0-rc.11-dev.46",
13
+ "@prisma/orm-family-sql": "8.0.0-rc.11-dev.47",
14
+ "@prisma/orm-framework": "8.0.0-rc.11-dev.47",
15
+ "@prisma/orm-target-sqlite": "8.0.0-rc.11-dev.47",
16
+ "@prisma/orm-toolchain": "8.0.0-rc.11-dev.47",
17
17
  "pathe": "^2.0.3"
18
18
  },
19
19
  "devDependencies": {
20
- "@internal/sqlite": "8.0.0-rc.11-dev.46",
21
- "@repo/tsconfig": "8.0.0-rc.11-dev.46",
22
- "@repo/tsdown": "8.0.0-rc.11-dev.46",
20
+ "@internal/sqlite": "8.0.0-rc.11-dev.47",
21
+ "@repo/tsconfig": "8.0.0-rc.11-dev.47",
22
+ "@repo/tsdown": "8.0.0-rc.11-dev.47",
23
23
  "tsdown": "0.22.14",
24
24
  "typescript": "5.9.3"
25
25
  },
@@ -15,7 +15,7 @@ description: >-
15
15
  ORM 7 or earlier (schema.prisma + @prisma/client).
16
16
  metadata:
17
17
  library: '@prisma/orm-sqlite'
18
- library_version: '8.0.0-rc.11-dev.46'
18
+ library_version: '8.0.0-rc.11-dev.47'
19
19
  version: '2026-09-12'
20
20
  ---
21
21
 
@@ -101,7 +101,7 @@ The single source of truth: read the envelope, find the row by `code`, follow th
101
101
  | `MIGRATION.PATH_UNREACHABLE` / `MIGRATION.MARKER_MISMATCH` | `db migrate` | Run `db migrate --show --db $URL` to inspect the path, then `migration plan --from <from> --to <target>` or `migration list` to audit the graph — see `references/migration-review.md`. |
102
102
  | `MIGRATION.PLAN_ORIGIN_UNKNOWN` / `MIGRATION.HASH_NOT_IN_GRAPH` / `MIGRATION.SNAPSHOT_MISSING` | `migration plan` | Origin resolution — `references/migration-model.md` § *The trap* and `references/migrations.md` § *Dev → ship transition*. |
103
103
  | `MIGRATION.MISSING_INVARIANTS` | `migration status` `warn` diagnostic (exit 0) | The live marker reached the destination hash structurally but doesn't carry all invariants the target ref requires. Run `db migrate --to <name> --db $URL` to take a path that covers the missing invariants. See `references/migration-review.md`. |
104
- | `MIGRATION.MARKER_NOT_IN_HISTORY` / `CONTRACT.UNREADABLE` | `migration status` `warn` diagnostics (exit 0; CI gates parse `--json`) | Read `severity` *and* `code`. Up-to-date / pending / no-marker states are not codes — read `spaces[].currentContract` and `migrations[].status` in the `--json` document. `references/migration-review.md` covers the marker-out-of-history flow. |
104
+ | `MIGRATION.MARKER_NOT_IN_HISTORY` / `CONTRACT.UNREADABLE` | `migration status` `warn` diagnostics (exit 0) | Read `severity` *and* `code`. Up-to-date / pending / no-marker states are not codes — read `spaces[].currentContract` and `migrations[].status` in the `--json` document. `references/migration-review.md` covers the marker-out-of-history flow. |
105
105
  | `BUDGET.ROWS_EXCEEDED` / `BUDGET.TIME_EXCEEDED` | Runtime, when the `budgets` middleware is active | Tune `budgets({ maxRows, maxLatencyMs, ... })` or rewrite the query. See `references/runtime.md`. |
106
106
  | `LINT.SELECT_STAR` / `LINT.NO_LIMIT` / `LINT.DELETE_WITHOUT_WHERE` / `LINT.UPDATE_WITHOUT_WHERE` / `LINT.READ_ONLY_MUTATION` | Runtime, when the `lints` middleware is active | Fix the query (add a `WHERE` / `LIMIT` / explicit columns), or relax the lint config. See `references/runtime.md`. |
107
107
  | `PLAN.HASH_MISMATCH` | Runtime, executing a precompiled plan | The contract the plan was built against does not match the runtime contract. Re-emit, rebuild, redeploy. |
@@ -84,8 +84,6 @@ These codes surface on `migration plan`, `migration ref set`, and `db migrate`
84
84
  | `MIGRATION.MARKER_MISMATCH` | `db migrate` (pre-DDL, before the runner) | Live DB marker hash is not a graph node — drift the offline planner cannot see. | `migration plan --from <graph-tip>` if the marker is canonical; `migration ref set db <marker-hash>` if the on-disk graph is canonical; investigate out-of-band applies. |
85
85
  | `MIGRATION.PATH_UNREACHABLE` | `db migrate` (path resolution) | No migration path from the current marker to the resolved target in the on-disk graph. | Read the improved `fix` payload — it names `fromHash` / `targetHash` and suggests `migration plan --from <from> --to <target>`; run `migration list` to inspect the graph. |
86
86
 
87
- A CI gate should read `diagnostics` from `--json` output and decide based on `severity` plus `code`; see *Workflow — CI* below for the structure.
88
-
89
87
  ## Workflow — *"What's about to run on deploy?"*
90
88
 
91
89
  The user asks: *"I'm about to merge this PR. What migrations are going to run when I deploy to staging?"*
@@ -166,46 +164,18 @@ The mismatch is a fact about *two pieces of state that disagree*. The investigat
166
164
 
167
165
  `migration ref set` to silently align the ref with whatever the DB happens to be at is almost never the right move. It papers over drift that you'll pay for later.
168
166
 
169
- ## Workflow — CI: verify a branch can advance the target environment
170
-
171
- The gate is `migration status --to <env> --db $URL`: it computes the path from the live marker to the ref and reports it, without mutating anything. There is no `--dry-run` flag on `db migrate`; the inspect / gate step is `migration status`.
167
+ ## Workflow — CI: deploy to an environment
172
168
 
173
- For a human-readable ordered preview of the migration path before applying, use `db migrate --show --db $URL`. For applied history after a deploy, use `migration log --db $URL` (flat chronological table).
169
+ The whole job is one command:
174
170
 
175
171
  ```yaml
176
- - name: Verify staging is reachable
177
- run: |
178
- pnpm prisma migration status \
179
- --to staging --db "$STAGING_DATABASE_URL" --json > status.json
180
- node -e '
181
- const s = JSON.parse(require("fs").readFileSync("status.json", "utf8"));
182
- const problems = [];
183
- for (const d of s.diagnostics ?? []) {
184
- if (d.severity === "warn") problems.push(`${d.code}: ${d.message}`);
185
- }
186
- for (const space of s.spaces ?? []) {
187
- if (space.currentContract === null) problems.push(`${space.space}: database has no marker`);
188
- const unreachable = space.migrations.filter(m => m.status === "unreachable");
189
- if (unreachable.length) problems.push(`${space.space}: ${unreachable.length} unreachable migration(s)`);
190
- }
191
- // Pending migrations are the normal case before Apply; block on them
192
- // only if this job is a verify-only gate (set EXPECT_UP_TO_DATE=1).
193
- if (process.env.EXPECT_UP_TO_DATE === "1") {
194
- for (const space of s.spaces ?? []) {
195
- const pending = space.migrations.filter(m => m.status === "pending");
196
- if (pending.length) problems.push(`${space.space}: ${pending.length} pending migration(s)`);
197
- }
198
- }
199
- if (problems.length) {
200
- console.error("Blocking:\n" + problems.join("\n"));
201
- process.exit(1);
202
- }
203
- '
204
- - name: Apply
172
+ - name: Migrate staging
205
173
  run: pnpm prisma db migrate --to staging --db "$STAGING_DATABASE_URL"
206
174
  ```
207
175
 
208
- `migration status` exits non-zero only on hard errors (unreadable migrations directory, unsatisfiable invariants, unreconstructable history). Pending migrations, a missing marker (`currentContract: null`), and the `warn` diagnostics (`MIGRATION.MARKER_NOT_IN_HISTORY`, `MIGRATION.MISSING_INVARIANTS`, `CONTRACT.UNREADABLE`) all leave the exit code at `0` — the agent (or a CI gate) must inspect `spaces[]` and `diagnostics[]` and fail the build itself. Use `--json` so the gate parses a structured shape rather than the human summary.
176
+ `db migrate` is safe to run unattended, by design. Before any operation runs it reads the live marker and refuses with `MIGRATION.MARKER_MISMATCH` if that hash is not a node in the on-disk graph, which is what a database changed outside the migration system looks like. Each operation then evaluates its own `precheck[]` and stops if the database is not in the state the operation expects. A successful run writes the destination hash as the new marker. Nothing runs before `db migrate` in the job.
177
+
178
+ `migration status --to staging --db $URL` is what a human or agent runs to answer *"what will run on deploy?"* before merging: it reports the path from the live marker to the ref without changing anything. `db migrate --show --db $URL` gives the same path as an ordered preview; `migration log --db $URL` gives the applied history after a deploy.
209
179
 
210
180
  `db migrate` is interactive-free and has no destructive-op confirmation prompt — the safety rails that prompt for destructive changes live on `db update` (see the `references/migrations.md` skill). Whatever the planner put in the migration graph is what `db migrate` runs; review happens at `migration plan` and at `migration status` time, before the apply step.
211
181
 
@@ -235,7 +205,7 @@ This skill is intentionally body-only; the underlying CLI reference (`prisma mig
235
205
  - [ ] For concurrent-migration conflicts: re-applied the *core* workflow (edit → plan → apply) rather than following a memorised "diamond convergence" procedure. Ported any data-transform logic from the abandoned `migration.ts` over.
236
206
  - [ ] For a ref-mismatch: investigated *which* piece of state is wrong (DB ahead, DB behind, DB on a divergent branch). Did NOT `migration ref set` to silence the mismatch.
237
207
  - [ ] Surfaced the destructive-op count from `migration status` (the only operation class that warrants manual review pre-deploy) before the user merges or deploys.
238
- - [ ] In CI: parsed `migration status --json` `diagnostics[]` and gated on `severity === 'warn'`; did NOT rely on a `--dry-run` flag on `db migrate` (no such flag exists).
208
+ - [ ] In CI: the deploy job is `prisma db migrate --to <ref> --db $URL` and nothing else. Did NOT rely on a `--dry-run` flag on `db migrate` (no such flag exists).
239
209
  - [ ] Did NOT confuse `--to` with database selection (`--to` picks the destination hash; `--db` picks the database).
240
210
  - [ ] Did NOT use `--ref` (removed; use `--to`).
241
211
  - [ ] Did NOT confabulate a "branch diff" CLI subcommand, a `migration revalidate` step, or any other API the skill above doesn't reference.