@prisma/orm-mongo 8.0.0-rc.5 → 8.0.0-rc.5-dev.1

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.
Files changed (64) hide show
  1. package/package.json +11 -10
  2. package/skills/prisma-8/SKILL.md +84 -0
  3. package/skills/prisma-8/references/build.md +142 -0
  4. package/skills/prisma-8/references/contract.md +417 -0
  5. package/skills/prisma-8/references/debug.md +141 -0
  6. package/skills/prisma-8/references/feedback.md +251 -0
  7. package/skills/prisma-8/references/migration-review.md +224 -0
  8. package/skills/prisma-8/references/migrations.md +519 -0
  9. package/skills/prisma-8/references/queries-mongo.md +236 -0
  10. package/skills/prisma-8/references/queries-postgres.md +415 -0
  11. package/skills/prisma-8/references/queries.md +168 -0
  12. package/skills/prisma-8/references/quickstart.md +326 -0
  13. package/skills/prisma-8/references/runtime.md +344 -0
  14. package/skills/prisma-8/references/supabase.md +244 -0
  15. package/skills/prisma-8/references/upgrade-app.md +101 -0
  16. package/skills/prisma-8/references/upgrade-extension.md +105 -0
  17. package/skills/prisma-8/upgrading/app/upgrades/0.10-to-0.11/instructions.md +56 -0
  18. package/skills/prisma-8/upgrading/app/upgrades/0.11-to-0.12/instructions.md +381 -0
  19. package/skills/prisma-8/upgrading/app/upgrades/0.11-to-0.12/re-emit-closed-mongo-contracts.ts +202 -0
  20. package/skills/prisma-8/upgrading/app/upgrades/0.11-to-0.12/re-emit-domain-namespaced-contracts.ts +201 -0
  21. package/skills/prisma-8/upgrading/app/upgrades/0.11-to-0.12/re-emit-postgres-public-default.ts +198 -0
  22. package/skills/prisma-8/upgrading/app/upgrades/0.11-to-0.12/strip-migration-labels-hints.ts +340 -0
  23. package/skills/prisma-8/upgrading/app/upgrades/0.12-to-0.13/instructions.md +339 -0
  24. package/skills/prisma-8/upgrading/app/upgrades/0.12-to-0.13/re-emit-mti-variant-link-columns.ts +229 -0
  25. package/skills/prisma-8/upgrading/app/upgrades/0.13-to-0.14/instructions.md +543 -0
  26. package/skills/prisma-8/upgrading/app/upgrades/0.13-to-0.14/migration-op-factories-to-methods.ts +290 -0
  27. package/skills/prisma-8/upgrading/app/upgrades/0.13-to-0.14/uuid-preset-rename.ts +43 -0
  28. package/skills/prisma-8/upgrading/app/upgrades/0.14-to-0.15/instructions.md +359 -0
  29. package/skills/prisma-8/upgrading/app/upgrades/0.15-to-0.16/instructions.md +173 -0
  30. package/skills/prisma-8/upgrading/app/upgrades/0.16-to-0.17/instructions.md +805 -0
  31. package/skills/prisma-8/upgrading/app/upgrades/0.16-to-0.17/strip-sha256-hash-prefixes.ts +382 -0
  32. package/skills/prisma-8/upgrading/app/upgrades/0.17-to-8.0.0-rc.1/instructions.md +72 -0
  33. package/skills/prisma-8/upgrading/app/upgrades/0.7-to-0.8/instructions.md +8 -0
  34. package/skills/prisma-8/upgrading/app/upgrades/0.8-to-0.9/instructions.md +36 -0
  35. package/skills/prisma-8/upgrading/app/upgrades/0.8-to-0.9/strip-inline-contracts.ts +226 -0
  36. package/skills/prisma-8/upgrading/app/upgrades/0.9-to-0.10/instructions.md +86 -0
  37. package/skills/prisma-8/upgrading/app/upgrades/0.9-to-0.10/stamp-storage-types-kind.ts +360 -0
  38. package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.1-to-8.0.0-rc.2/instructions.md +588 -0
  39. package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.2-to-8.0.0-rc.3/instructions.md +5 -0
  40. package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.3-to-8.0.0-rc.4/instructions.md +158 -0
  41. package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.4-to-8.0.0-rc.5/instructions.md +42 -0
  42. package/skills/prisma-8/upgrading/extension/upgrades/0.10-to-0.11/instructions.md +276 -0
  43. package/skills/prisma-8/upgrading/extension/upgrades/0.11-to-0.12/instructions.md +738 -0
  44. package/skills/prisma-8/upgrading/extension/upgrades/0.11-to-0.12/migrate-contract-testing-imports.ts +97 -0
  45. package/skills/prisma-8/upgrading/extension/upgrades/0.11-to-0.12/regenerate-extension-public-baseline.ts +223 -0
  46. package/skills/prisma-8/upgrading/extension/upgrades/0.11-to-0.12/strip-migration-labels-hints.ts +340 -0
  47. package/skills/prisma-8/upgrading/extension/upgrades/0.12-to-0.13/instructions.md +266 -0
  48. package/skills/prisma-8/upgrading/extension/upgrades/0.13-to-0.14/instructions.md +522 -0
  49. package/skills/prisma-8/upgrading/extension/upgrades/0.13-to-0.14/migration-op-factories-to-methods.ts +290 -0
  50. package/skills/prisma-8/upgrading/extension/upgrades/0.13-to-0.14/uuid-preset-rename.ts +43 -0
  51. package/skills/prisma-8/upgrading/extension/upgrades/0.14-to-0.15/instructions.md +803 -0
  52. package/skills/prisma-8/upgrading/extension/upgrades/0.15-to-0.16/instructions.md +219 -0
  53. package/skills/prisma-8/upgrading/extension/upgrades/0.16-to-0.17/instructions.md +731 -0
  54. package/skills/prisma-8/upgrading/extension/upgrades/0.16-to-0.17/strip-sha256-hash-prefixes.ts +382 -0
  55. package/skills/prisma-8/upgrading/extension/upgrades/0.17-to-8.0.0-rc.1/instructions.md +194 -0
  56. package/skills/prisma-8/upgrading/extension/upgrades/0.7-to-0.8/instructions.md +8 -0
  57. package/skills/prisma-8/upgrading/extension/upgrades/0.8-to-0.9/instructions.md +57 -0
  58. package/skills/prisma-8/upgrading/extension/upgrades/0.8-to-0.9/strip-inline-contracts.ts +226 -0
  59. package/skills/prisma-8/upgrading/extension/upgrades/0.9-to-0.10/instructions.md +150 -0
  60. package/skills/prisma-8/upgrading/extension/upgrades/0.9-to-0.10/stamp-storage-types-kind.ts +360 -0
  61. package/skills/prisma-8/upgrading/extension/upgrades/8.0.0-rc.1-to-8.0.0-rc.2/instructions.md +746 -0
  62. package/skills/prisma-8/upgrading/extension/upgrades/8.0.0-rc.2-to-8.0.0-rc.3/instructions.md +5 -0
  63. package/skills/prisma-8/upgrading/extension/upgrades/8.0.0-rc.3-to-8.0.0-rc.4/instructions.md +137 -0
  64. package/skills/prisma-8/upgrading/extension/upgrades/8.0.0-rc.4-to-8.0.0-rc.5/instructions.md +129 -0
@@ -0,0 +1,101 @@
1
+ # Upgrade Prisma 8 (user app)
2
+
3
+ This reference upgrades a project that **consumes** Prisma 8 via the public package API (`@internal/postgres`, `@internal/mongo`, the contract files in `prisma/`, etc.). If the project is itself a Prisma 8 *extension*, use [`upgrade-extension.md`](upgrade-extension.md) instead — or both, if the repo contains both an app and an extension package.
4
+
5
+ The per-transition instructions this reference reads live under [`../upgrading/app/upgrades/`](../upgrading/app/upgrades/).
6
+
7
+ ## Step 0 — Upgrade to the newest instructions, then re-read
8
+
9
+ The upgrade instructions ship inside the installed Prisma packages, so the copy on disk describes the version currently installed — not the version being upgraded *to*. Bug fixes to *old* per-transition instructions ship with each release as part of the cumulative set, so the newest copy is the one to run.
10
+
11
+ Do the version bump first (step 1 of the per-step flow below), re-sync the skills from the newly installed packages (`prisma skills sync`), and re-read this reference and the per-transition instructions before applying any code translation. If the agent runtime supports an in-session refresh, perform it after the sync; otherwise finish the session's reasoning against the re-read files.
12
+
13
+ ## Pre-flight — extension compatibility
14
+
15
+ Before changing any code, refuse to upgrade past any installed extension's pinned Prisma Next version. Extensions in Prisma Next pin every `@internal/*` dependency to a single exact version (no carets, no ranges); that pin is the highest version the extension has been validated against. Upgrading the user app past that pin would silently desynchronise the extension's type identity from the app's.
16
+
17
+ Steps:
18
+
19
+ 1. **Read `prisma.config.ts`** (or its TS-discoverable equivalent at the project root) and enumerate the list of extension packages it imports. Each `extensions: [...]` entry corresponds to an installed npm package.
20
+ 2. **For each extension**, read its installed `package.json` from `node_modules/<extension-package-name>/package.json` and find any `@internal/*` entry under `dependencies`, `peerDependencies`, or `optionalDependencies`. By construction those entries are exact-version pins (e.g. `"0.7.0"`), set when the extension author last ran their own upgrade.
21
+ 3. **Compute the lowest pinned version across all extensions.** That is the highest Prisma Next version reachable by this app on its current extension set.
22
+ 4. **Compare to the user's target.** If the target exceeds the lowest pin, halt with a structured message naming each lagging extension and its pinned version, and offer two paths:
23
+ - (a) Wait for the lagging extension to publish a compatible release, then re-run.
24
+ - (b) Re-run with `--to=<highest-reachable>` (or whatever flag/option the user is using to set the target).
25
+
26
+ Do not auto-downgrade the target; do not skip the lagging extension; do not bump past it. If the user explicitly overrides the halt, surface the risk clearly first.
27
+
28
+ If `prisma.config.ts` is absent or names no extensions, skip the pre-flight.
29
+
30
+ ## Role detection
31
+
32
+ This flow applies when the project **consumes** Prisma Next:
33
+
34
+ - `package.json` declares one or more `@internal/*` packages under `dependencies` / `devDependencies`, and
35
+ - the package is *not* itself an extension (no `@internal/contract` (or other SPI) under `dependencies`/`peerDependencies`; name does not match `^@.*/extension-`; not referenced from a sibling app's `prisma.config.ts`).
36
+
37
+ If the project also matches the extension-author role, run **this** flow first and then [`upgrade-extension.md`](upgrade-extension.md) in the same session. If detection is ambiguous, ask the user.
38
+
39
+ ## Version detection
40
+
41
+ - **From-version.** Read the currently-installed Prisma Next version from `pnpm-lock.yaml` (or `package-lock.json` / `yarn.lock`) by inspecting the resolved version of any `@internal/*` package. If the lockfile shows multiple `@internal/*` packages at different minors (already broken), the **lowest** minor is the from-version.
42
+ - **To-version.** Either the version the user specified, or whatever `npm view @internal/postgres dist-tags.latest` reports. Do not assume that is a stable version: while Prisma 8 is a release candidate, `latest` tracks the newest release, `8.0.0-rc.N` included. If the user wants a stable version specifically, they must name it.
43
+
44
+ Report both back to the user before continuing.
45
+
46
+ ## Transition chain
47
+
48
+ If the from-to delta spans more than one release (e.g. `0.6 → 0.8`), build the chain of steps between them:
49
+
50
+ ```text
51
+ 0.6 → 0.7 → 0.8
52
+ ```
53
+
54
+ The [`../upgrading/app/upgrades/`](../upgrading/app/upgrades/) directories name the steps — read the chain off the directory names rather than deriving it arithmetically. Each directory is `<from>-to-<to>`. A step is one minor while the version line is stable (`0.7-to-0.8`); on the v8 release-candidate line a step is one release candidate (`8.0.0-rc.1-to-8.0.0-rc.2`), because an RC may carry breaking changes and each one needs its own translation. Moving onto the RC line from the last stable minor is a single step of its own (`0.17-to-8.0.0-rc.1`).
55
+
56
+ Apply each step in order, fully: bump, install, run instructions, validate, commit — before moving to the next. Halt the chain on the first failed step; do not skip ahead.
57
+
58
+ The chain order does not depend on which extensions are installed; the pre-flight has already established the target is reachable.
59
+
60
+ ## Per-step flow
61
+
62
+ For each `(from, to)` step in the chain:
63
+
64
+ 1. **Bump `@internal/*` deps.** Rewrite every `@internal/*` entry in the project's `package.json` to the exact `<to>` version (no caret, no tilde). All entries advance to the same version. Cover `dependencies` and `devDependencies`. The skill itself ships inside the Prisma packages, so bumping them is what updates it; there is no separate skill package to bump.
65
+
66
+ 2. **Install.** Run `pnpm install` (or the project's lockfile-managing command). The project's code is now broken against the new types — the upgrade instructions for `<from> → <to>` exist to fix it.
67
+
68
+ 3. **Read the upgrade instructions.** Re-sync the skills (`prisma skills sync`) so the tree matches the version just installed, then load `../upgrading/app/upgrades/<from>-to-<to>/instructions.md`. Parse the YAML frontmatter and pay particular attention to its `changes[]` array.
69
+
70
+ 4. **Apply each change.** For each entry in `changes[]`:
71
+ - If the entry has a `detection` block (glob + content predicate), run it; skip the change if no files match. No `detection` → apply unconditionally.
72
+ - If the entry names a `script:` (a relative path next to `instructions.md`), invoke it from the project root:
73
+ - `*.ts` → `pnpm exec tsx <skill>/upgrading/app/upgrades/<from>-to-<to>/<script>`
74
+ - `*.sh` → `bash <skill>/upgrading/app/upgrades/<from>-to-<to>/<script>`
75
+ - codemods → invoke per the script's own prose.
76
+
77
+ No `script` → follow the prose body directly.
78
+
79
+ Empty `changes[]` (placeholder shape for transitions with no user-side breaking changes) is a no-op — proceed to validation.
80
+
81
+ 5. **Validate.** Run `pnpm typecheck && pnpm test` (or the project's equivalent — the `scripts` field of the project's `package.json` is the discovery surface). If anything is red, halt the chain. Do **not** auto-roll-back; surface the failure to the user with the failing change's `id` (from the frontmatter), the file paths the change operated on, and the inferred remediation.
82
+
83
+ 6. **Commit.** One commit per step containing the `package.json` bump, lockfile churn, and any source rewrites:
84
+
85
+ ```text
86
+ chore: upgrade @internal/* to <to-version>
87
+ ```
88
+
89
+ (Or the project's own commit-message convention.) Never squash steps. The user may squash on merge; the in-flight history must be per-step so a failed step is bisectable.
90
+
91
+ Then move on to the next step.
92
+
93
+ ## When the chain is done
94
+
95
+ Report back to the user: the number of steps applied, the SHAs of the commits you made, and any open follow-ups (e.g. tests that were already red before the upgrade and still are).
96
+
97
+ ## Failure surfaces
98
+
99
+ When a step fails: surface a structured error with code `PN-UPGRADE-NNNN`, the failing change's `id`, the file paths touched (or the lockfile, or the validation command), and the inferred remediation. Do not retry automatically; do not auto-roll-back. The user can revert if they want a clean slate.
100
+
101
+ If a pre-flight halt fires, do not bump anything; the project is left unchanged.
@@ -0,0 +1,105 @@
1
+ # Upgrade Prisma 8 (extension)
2
+
3
+ This reference upgrades a project that **is** a Prisma 8 extension — a package that consumes the framework SPI (`@internal/contract`, `@internal/framework-components`, `@internal/migration-tools`, etc.) and exposes contract / middleware / codec / migration surfaces that downstream apps install via `prisma.config.ts`.
4
+
5
+ If the project you are upgrading is a consumer **app** (it imports `@internal/postgres` or `@internal/mongo` from its application code), use [`upgrade-app.md`](upgrade-app.md) instead — or both, if the repo contains both a consumer app and an extension package, in which case run the app flow first then this one in the same session.
6
+
7
+ The per-transition instructions this reference reads live under [`../upgrading/extension/upgrades/`](../upgrading/extension/upgrades/).
8
+
9
+ ## Step 0 — Upgrade to the newest instructions, then re-read
10
+
11
+ The upgrade instructions ship inside the installed Prisma packages, so the copy on disk describes the version currently installed — not the version being upgraded *to*. Bug fixes to *old* per-transition instructions ship with each release as part of the cumulative set, so the newest copy is the one to run.
12
+
13
+ Do the version bump first (step 1 of the per-step flow below), re-sync the skills from the newly installed packages (`prisma skills sync`), and re-read this reference and the per-transition instructions before applying any code translation.
14
+
15
+ ## Role detection
16
+
17
+ This flow applies when the project **is** a Prisma Next extension. Heuristics:
18
+
19
+ - `package.json` declares `@internal/contract` (or another SPI package) under `dependencies` or `peerDependencies`, and
20
+ - the package's `name` matches `^@.*/extension-` (the in-tree convention used by `@internal/extension-pgvector`, etc.), or
21
+ - the package is referenced as an `extensions` entry from a sibling app's `prisma.config.ts` in the same monorepo.
22
+
23
+ If the project additionally consumes Prisma Next from its own app code, run [`upgrade-app.md`](upgrade-app.md) first, then this flow in the same session.
24
+
25
+ If detection is ambiguous, ask the user which role to operate under.
26
+
27
+ ## Version detection
28
+
29
+ - **From-version.** Read the currently-installed Prisma Next version from `pnpm-lock.yaml` (or `package-lock.json` / `yarn.lock`) by inspecting the resolved version of any `@internal/*` entry. If the lockfile shows multiple `@internal/*` packages at different minors, the lowest minor is the from-version.
30
+ - **To-version.** Either the version the user specified, or whatever `npm view @internal/contract dist-tags.latest` reports. Do not assume that is a stable version: while Prisma 8 is a release candidate, `latest` tracks the newest release, `8.0.0-rc.N` included. If the user wants a stable version specifically, they must name it.
31
+
32
+ Report both back to the user before continuing.
33
+
34
+ ## Transition chain
35
+
36
+ If the from-to delta spans more than one release (e.g. `0.6 → 0.8`), build the chain of steps between them:
37
+
38
+ ```text
39
+ 0.6 → 0.7 → 0.8
40
+ ```
41
+
42
+ The [`../upgrading/extension/upgrades/`](../upgrading/extension/upgrades/) directories name the steps — read the chain off the directory names rather than deriving it arithmetically. Each directory is `<from>-to-<to>`. A step is one minor while the version line is stable (`0.7-to-0.8`); on the v8 release-candidate line a step is one release candidate (`8.0.0-rc.1-to-8.0.0-rc.2`), because an RC may carry breaking changes and each one needs its own translation. Moving onto the RC line from the last stable minor is a single step of its own (`0.17-to-8.0.0-rc.1`).
43
+
44
+ Apply each step in order, fully: bump, install, run instructions, check pins, validate, commit — before moving to the next. Halt the chain on the first failed step.
45
+
46
+ ## Per-step flow
47
+
48
+ This flow assumes you are an **external extension author** — your extension lives in its own repo and consumes `@internal/*` from npm. (Extensions inside the `prisma/prisma` monorepo itself are bumped via `pnpm bump-version` / `scripts/set-version.ts`, which rewrites every `workspace:<X.Y.Z>` spec in lockstep with the root version; they do not run this skill.)
49
+
50
+ For each `(from, to)` step in the chain:
51
+
52
+ 1. **Bump `@internal/*` deps.** Rewrite every `@internal/*` entry in the extension's `package.json` to the exact `<to>` version (e.g. `"0.8.0"` — no caret, no tilde, no range, no `workspace:` specifier; the exact-pin rule below details why). All entries advance to the same version. Cover whichever dep field(s) the extension uses today — `dependencies` and/or `peerDependencies` — and any `optionalDependencies`. The skill itself ships inside the Prisma packages, so bumping them is what updates it; there is no separate skill package to bump. The companion CLI tool is `@internal/extension-author-tools` — leave its pin at the version the extension's CI is currently using; bumping it is independent of the framework upgrade and is normally a no-op.
53
+
54
+ 2. **Install.** Run `pnpm install` (or the project's lockfile-managing command). The extension's source is now broken against the new SPI — the upgrade instructions for `<from> → <to>` exist to fix it.
55
+
56
+ 3. **Check pins.** Run `pnpm exec prisma-8-check-pins` (shipped by `@internal/extension-author-tools`). This sanity check asserts that every `@internal/*` entry across `dependencies`, `peerDependencies`, and `optionalDependencies` is a single exact-version string and that all entries share the same version. If the check fails, the bump step did not rewrite every spec — fix the offending entries and re-run before proceeding.
57
+
58
+ 4. **Read the upgrade instructions.** Re-sync the skills (`prisma skills sync`) so the tree matches the version just installed, then load `../upgrading/extension/upgrades/<from>-to-<to>/instructions.md`. Parse the YAML frontmatter and pay particular attention to its `changes[]` array.
59
+
60
+ 5. **Apply each change.** For each entry in `changes[]`:
61
+ - If the entry has a `detection` block (a glob + content predicate), run it. If no files match, skip this change.
62
+ - If the entry has no `detection`, apply unconditionally.
63
+ - If the entry names a `script:` (a relative path next to `instructions.md`), invoke it from the project root:
64
+ - `*.ts` → `pnpm exec tsx <skill>/upgrading/extension/upgrades/<from>-to-<to>/<script>`
65
+ - `*.sh` → `bash <skill>/upgrading/extension/upgrades/<from>-to-<to>/<script>`
66
+ - codemods → invoke per the script's own `instructions.md` prose.
67
+ - If the entry has no `script`, follow the prose body in `instructions.md` directly.
68
+
69
+ If `changes[]` is empty (the placeholder shape for transitions with no extension-side breaking changes), this sub-step is a no-op — proceed to validation.
70
+
71
+ 6. **Validate.** Run `pnpm build && pnpm test` (or the project's equivalent — the `scripts` field of the extension's `package.json` is the discovery surface). If anything is red, halt the chain. Do **not** auto-roll-back; surface the failure to the user with the failing change's `id` (from the frontmatter), the file paths the change operated on, and the inferred remediation.
72
+
73
+ 7. **Commit.** Create one commit containing this step's changes: the `package.json` bump, the lockfile churn from `pnpm install`, and any source-file rewrites from the applied changes. Use the message:
74
+
75
+ ```text
76
+ chore: upgrade @internal/* to <to-version>
77
+ ```
78
+
79
+ (Or the extension's own commit-message convention, if it has one.) One commit per step — never squash steps.
80
+
81
+ Move on to the next step. Repeat.
82
+
83
+ ## Exact-pin rule
84
+
85
+ Prisma Next extensions pin every `@internal/*` dependency to a single **exact** version (no `^`, no `~`, no range, no wildcard, no `workspace:` specifier in the published `package.json`). All `@internal/*` entries share the same version. The pin advances only after a successful upgrade run against the new minor.
86
+
87
+ `prisma-8-check-pins` (shipped by `@internal/extension-author-tools` — install with `pnpm add -D @internal/extension-author-tools`) enforces the rule. Run it locally with:
88
+
89
+ ```bash
90
+ pnpm exec prisma-8-check-pins
91
+ ```
92
+
93
+ Wire it into the extension's CI alongside the build/test step so an accidental range pin fails the PR before it lands.
94
+
95
+ ## When the chain is done
96
+
97
+ Report back to the user: the number of steps applied, the SHAs of the commits you made, and any open follow-ups.
98
+
99
+ ## Failure surfaces
100
+
101
+ When a step fails:
102
+
103
+ - Surface a structured error with code `PN-UPGRADE-NNNN`, the failing change's `id`, the file paths the change touched (or the lockfile, or the pin check, or the validation command), and the inferred remediation.
104
+ - Do not retry automatically.
105
+ - Do not auto-roll-back the commit. The user can revert if they want a clean slate.
@@ -0,0 +1,56 @@
1
+ ---
2
+ from: "0.10"
3
+ to: "0.11"
4
+ changes:
5
+ - id: insert-single-row-wrap-in-array
6
+ summary: Wrap single-row `.insert({...})` call sites in an array — `.insert([{...}])`. The single-object overload is removed; `.insert()` now exclusively accepts an array of row objects.
7
+ detection:
8
+ glob: "**/*.{ts,tsx}"
9
+ contains:
10
+ - ".insert("
11
+ anyMatch: true
12
+ ---
13
+
14
+ # 0.10 → 0.11 — User upgrade instructions
15
+
16
+ ## `insert-single-row-wrap-in-array`
17
+
18
+ Starting at the 0.11 release, the `.insert()` method on the SQL builder accepts **only** an array of row objects. The single-object overload that previously allowed `.insert({ field: value })` is removed.
19
+
20
+ Before 0.11:
21
+
22
+ ```ts
23
+ await runtime.execute(db.sql.user.insert({ email: 'alice@example.com' }).build());
24
+ ```
25
+
26
+ Starting at 0.11:
27
+
28
+ ```ts
29
+ await runtime.execute(db.sql.user.insert([{ email: 'alice@example.com' }]).build());
30
+ ```
31
+
32
+ Walk every `.ts` / `.tsx` file matched by the `detection.glob` above. For each call site that passes a plain object directly to `.insert(...)`, wrap the argument in an array:
33
+
34
+ - `.insert(row)` → `.insert([row])`
35
+ - `.insert({ field: value })` → `.insert([{ field: value }])`
36
+
37
+ Variable references to a row object are safe to wrap directly:
38
+
39
+ ```ts
40
+ // Before
41
+ for (const item of items) {
42
+ await runtime.execute(db.sql.table.insert(item).build());
43
+ }
44
+ // After
45
+ for (const item of items) {
46
+ await runtime.execute(db.sql.table.insert([item]).build());
47
+ }
48
+ ```
49
+
50
+ If a call site already passes an array (`.insert([row1, row2])`), it is already correct — leave it unchanged.
51
+
52
+ TypeScript will flag bare-object call sites as type errors after the bump, providing a reliable compile-time signal for every affected site.
53
+
54
+ ### Validation
55
+
56
+ After applying the rule above, run `pnpm typecheck && pnpm test` (or your application's equivalent). The change is mechanical — every affected call site is flagged at compile time.
@@ -0,0 +1,381 @@
1
+ ---
2
+ from: "0.11"
3
+ to: "0.12"
4
+ changes:
5
+ - id: replace-verify-with-verify-marker
6
+ summary: |
7
+ The SQL runtime's `verify: { mode; requireMarker }` option is removed; replaced by `verifyMarker?: 'onFirstUse' | false` (default `'onFirstUse'`). The runtime no longer throws on contract-marker drift — instead it emits a structured `warn`-level log line once per runtime instance and proceeds with the query. Callers that previously caught `CONTRACT.MARKER_MISMATCH` to detect deploy-skew migrate to log scraping (filter on `code: 'CONTRACT.MARKER_MISMATCH'` / `code: 'CONTRACT.MARKER_MISSING'` from the runtime's `Log.warn` sink) or invoke the explicit `db-verify` CLI for fail-fast verification.
8
+ detection:
9
+ glob: "**/*.{ts,tsx}"
10
+ contains:
11
+ - "verify:"
12
+ - "requireMarker"
13
+ anyMatch: false
14
+ - id: remove-capabilities-from-define-contract
15
+ summary: |
16
+ The `capabilities` field on the first argument of `defineContract({...}, ...)` is removed. Capabilities are now contributed automatically by extension packs and target components; declaring them by hand is no longer accepted and the contract builder will refuse the literal. Delete the `capabilities: { ... }` block from every `defineContract` call site, then re-emit your contract artefacts (`pnpm emit`, which runs `prisma-next contract emit`) to refresh `contract.json` / `contract.d.ts`. The regenerated artefacts pick up the contributor-declared capabilities — including two new ones in the 0.12 line, `postgres.distinctOn` and `sql.lateral`, which extensions contribute on your behalf when their pack is in `extensionPacks`.
17
+ detection:
18
+ glob: "**/*.{ts,tsx}"
19
+ contains:
20
+ - "defineContract"
21
+ - "capabilities:"
22
+ anyMatch: false
23
+ - id: strip-migration-labels-hints
24
+ summary: |
25
+ The 0.12 migration manifest schema is closed (`'+': 'reject'`) and the metadata model no longer carries `labels` or `hints`; any on-disk `migration.json` still holding either key fails to load with `INVALID_MANIFEST` naming the offending key. Both fields are also dropped from the content-addressed migration identity, so `migrationHash` is now computed over `{ from, to, providedInvariants, createdAt }` plus the sibling `ops.json`. Run the colocated codemod to strip both keys from every `migration.json` and recompute its `migrationHash` over the slimmed envelope.
26
+ detection:
27
+ glob: "**/migration.json"
28
+ contains:
29
+ - '"labels"'
30
+ - '"hints"'
31
+ anyMatch: true
32
+ script: ./strip-migration-labels-hints.ts
33
+ - id: re-emit-closed-mongo-contracts
34
+ summary: |
35
+ Re-emit Mongo contract artefacts so emitted `$jsonSchema` validators are closed (`additionalProperties: false` at every level, including polymorphic `oneOf` branches). Each non-variant Mongo model must resolve to an `objectId` `_id` before emit succeeds — otherwise interpret fails with `PSL_MONGO_ID_REQUIRED`. After re-emitting, apply the open→closed validator migration with `prisma-next db update -y`; the planner classifies the tightening as `destructive` and refuses without confirmation.
36
+ detection:
37
+ glob: "**/contract.json"
38
+ contains:
39
+ - '"kind": "mongo-database"'
40
+ anyMatch: true
41
+ script: ./re-emit-closed-mongo-contracts.ts
42
+ - id: public-default-namespace
43
+ summary: |
44
+ Un-namespaced Postgres models now emit under the `public` namespace instead of the `__unbound__` sentinel; explicit `namespace unbound { … }` in PSL still round-trips to `__unbound__`. Re-emit contract artefacts (`pnpm emit`, i.e. `prisma-next contract emit`) so `contract.json` / `contract.d.ts` pick up the new storage/domain namespace key (`__unbound__`/`postgres-unbound-schema` → `public`/`postgres-schema`). No hand-editing of emitted JSON is required when the PSL/TS contract source is unchanged.
45
+ detection:
46
+ glob: "**/contract.json"
47
+ contains:
48
+ - '"kind": "postgres-unbound-schema"'
49
+ anyMatch: true
50
+ script: ./re-emit-postgres-public-default.ts
51
+ - id: domain-plane-namespaced-contract
52
+ summary: |
53
+ `contract.models` / `contract.valueObjects` moved under `contract.domain.namespaces.<ns>` (symmetric domain plane). Re-emit contract artefacts (`pnpm emit`) so emitted JSON and `contract.d.ts` carry the namespaced domain envelope; generated types switch from `Contract['models']` to `ContractModelsMap<Contract>`.
54
+ detection:
55
+ glob: "**/contract.d.ts"
56
+ contains:
57
+ - "Contract['models']"
58
+ anyMatch: true
59
+ script: ./re-emit-domain-namespaced-contracts.ts
60
+ - id: runtime-qualified-sql-default-namespace
61
+ summary: |
62
+ Postgres runtime SQL now emits namespace-qualified table identifiers (e.g. `"public"."user"`). Flat `db.sql.*` / `db.*` call sites are unchanged. Update integration or snapshot tests that assert raw SQL strings. Re-emit contract artefacts only if you are still catching up an earlier 0.12 namespacing transition.
63
+ detection:
64
+ glob: "**/*.{ts,tsx}"
65
+ contains:
66
+ - 'FROM "user"'
67
+ anyMatch: true
68
+ ---
69
+
70
+ # 0.11 → 0.12 — User upgrade instructions
71
+
72
+ ## `replace-verify-with-verify-marker`
73
+
74
+ Starting at the 0.12 release, the SQL runtime's marker-verification API is simplified. The previous `verify: { mode; requireMarker }` option carried two concerns — *when* to verify and *whether to throw on absent markers* — both of which leaked internal implementation detail into the public API. The new option is a single discriminated union: `verifyMarker?: 'onFirstUse' | false`, with `'onFirstUse'` as the default.
75
+
76
+ The runtime's response to contract-marker drift also changes. Previously the runtime threw `CONTRACT.MARKER_MISMATCH` (or `CONTRACT.MARKER_MISSING`) on every query when the database's contract hash didn't match the runtime's. From 0.12 onward, the runtime emits a structured `warn`-level log line **once per runtime instance** and proceeds with the query. The intent is to make rolling deploys safe by default: a drifted-but-running app surfaces the warning loudly without crashing every query for the duration of the deploy window.
77
+
78
+ ### Migration
79
+
80
+ Walk every call site that constructs a SQL runtime via `createRuntime(...)` or the convenience wrappers (`sqlite(...)`, `postgres(...)`, `postgresServerless(...)`).
81
+
82
+ For each call site that passes `verify: {...}`:
83
+
84
+ - `verify: { mode: 'onFirstUse', requireMarker: false }` → `verifyMarker: 'onFirstUse'` (or simply omit the option — `'onFirstUse'` is the default).
85
+ - `verify: { mode: 'onFirstUse', requireMarker: true }` → `verifyMarker: 'onFirstUse'`. The `requireMarker: true` semantics (throw on absent marker) is removed; if you need fail-fast verification, use the `db-verify` CLI command at deploy time instead of relying on the runtime to crash.
86
+ - `verify: { mode: 'always', requireMarker: ... }` → `verifyMarker: 'onFirstUse'`. The `'always'` mode (re-verify on every query) is dropped; verification is now once-per-runtime regardless of mode. The CLI `db-verify` command remains the explicit-verification surface.
87
+ - `verify: { mode: 'startup', requireMarker: ... }` → `verifyMarker: 'onFirstUse'`. The `'startup'` mode is dropped for the same reason — without the throw-on-mismatch semantic, the `'startup'` vs `'onFirstUse'` distinction collapsed to "same behaviour, different timing." Verification fires lazily on the first `execute()` call.
88
+ - If you explicitly want to skip marker verification entirely (e.g. during a known-skewed deploy window where contract drift is expected and tolerated): `verifyMarker: false`.
89
+
90
+ ### Before 0.12
91
+
92
+ ```ts
93
+ const runtime = createRuntime({
94
+ stackInstance,
95
+ context,
96
+ driver,
97
+ verify: { mode: 'onFirstUse', requireMarker: false },
98
+ });
99
+
100
+ try {
101
+ for await (const row of runtime.execute(plan)) {
102
+ // ...
103
+ }
104
+ } catch (err) {
105
+ if (err.code === 'CONTRACT.MARKER_MISMATCH') {
106
+ // deploy-skew detected — crash and let the orchestrator restart us
107
+ process.exit(1);
108
+ }
109
+ throw err;
110
+ }
111
+ ```
112
+
113
+ ### Starting at 0.12
114
+
115
+ ```ts
116
+ const runtime = createRuntime({
117
+ stackInstance,
118
+ context,
119
+ driver,
120
+ log: {
121
+ info: console.info,
122
+ warn: (payload) => {
123
+ console.warn(payload);
124
+ if (
125
+ payload.code === 'CONTRACT.MARKER_MISMATCH' ||
126
+ payload.code === 'CONTRACT.MARKER_MISSING'
127
+ ) {
128
+ // optional: forward to your observability surface
129
+ sendToTelemetry(payload);
130
+ }
131
+ },
132
+ error: console.error,
133
+ },
134
+ // verifyMarker omitted — 'onFirstUse' is the default
135
+ });
136
+
137
+ for await (const row of runtime.execute(plan)) {
138
+ // ...
139
+ }
140
+ ```
141
+
142
+ The runtime now does not crash on drift — it emits one structured log line per runtime instance, then proceeds. Operators who want fail-fast verification at deploy time (rather than as a per-runtime diagnostic) should invoke the `db-verify` CLI as part of their deployment pipeline.
143
+
144
+ ### Type-level change
145
+
146
+ The `RuntimeVerifyOptions` type is removed from `@internal/sql-runtime` exports; replaced by `VerifyMarkerOption = 'onFirstUse' | false`. Any consumer code that imports `RuntimeVerifyOptions` will fail to compile after the bump.
147
+
148
+ ```diff
149
+ -import type { RuntimeVerifyOptions } from '@internal/sql-runtime';
150
+ +import type { VerifyMarkerOption } from '@internal/sql-runtime';
151
+ ```
152
+
153
+ ### Validation
154
+
155
+ After applying the rule above, run `pnpm typecheck && pnpm test` (or your application's equivalent). The change is mechanical: TypeScript flags every `verify: {...}` call site as a type error after the bump, and every `RuntimeVerifyOptions` import similarly. Once those errors are resolved, the behaviour change (warn-log instead of throw on drift) shows up only at runtime when a marker mismatch actually occurs.
156
+
157
+ ## `remove-capabilities-from-define-contract`
158
+
159
+ Starting at the 0.12 release, the `capabilities` field on the first argument of `defineContract({...}, ...)` is removed. Capabilities are now contributed automatically by the target's components and the extension packs you load via `extensionPacks: { ... }`; the contract builder will refuse a literal `capabilities` key. Hand-declaring capabilities was redundant with — and frequently drifted from — the contributor-declared set, so the authoring surface drops the field outright.
160
+
161
+ Two consumer-visible consequences:
162
+
163
+ - **Source change**: delete the `capabilities: { ... }` block from every `defineContract` call site.
164
+ - **Emitted artefacts**: the regenerated `contract.json` / `contract.d.ts` will pick up the contributor-declared capabilities. In the 0.12 line, two new capability keys land automatically — `postgres.distinctOn` and `sql.lateral` — when the matching adapter / target component is in the contract's component graph.
165
+
166
+ ### Before 0.12
167
+
168
+ ```ts
169
+ import { defineContract } from '@internal/postgres/contract-builder';
170
+ import { pgvector } from '@internal/pgvector';
171
+
172
+ export const contract = defineContract(
173
+ {
174
+ extensionPacks: { pgvector },
175
+ capabilities: {
176
+ postgres: {
177
+ lateral: true,
178
+ jsonAgg: true,
179
+ returning: true,
180
+ 'pgvector.cosine': true,
181
+ },
182
+ },
183
+ },
184
+ ({ field, model }) => {
185
+ // … model definitions …
186
+ },
187
+ );
188
+ ```
189
+
190
+ ### Starting at 0.12
191
+
192
+ ```ts
193
+ import { defineContract } from '@internal/postgres/contract-builder';
194
+ import { pgvector } from '@internal/pgvector';
195
+
196
+ export const contract = defineContract(
197
+ {
198
+ extensionPacks: { pgvector },
199
+ },
200
+ ({ field, model }) => {
201
+ // … model definitions …
202
+ },
203
+ );
204
+ ```
205
+
206
+ If your first argument becomes `{}` after the deletion (the only field it carried was `capabilities`), simplify to `defineContract({}, ({ field, model }) => { … })`. TypeScript flags any remaining `capabilities:` key on a `defineContract` call as an excess-property error after the bump, so every affected site is pinpointed at compile time.
207
+
208
+ ### Re-emit your contract
209
+
210
+ After updating the source, regenerate the emitted artefacts so the new contributor-declared capabilities land in `contract.json` and `contract.d.ts`:
211
+
212
+ ```bash
213
+ pnpm emit
214
+ # (runs `prisma-next contract emit` under the hood)
215
+ ```
216
+
217
+ You should see capability keys appear in the regenerated `contract.json` — for SQL targets, expect `postgres.distinctOn: true` and `sql.lateral: true` to show up if your contract uses the matching adapter / extensions.
218
+
219
+ ### Validation
220
+
221
+ After applying the rule above, run `pnpm typecheck && pnpm test` (or your application's equivalent). The change is mechanical and TypeScript pinpoints every affected call site; the regenerated `contract.json` diff confirms the capabilities flowed through unchanged.
222
+
223
+ ## `strip-migration-labels-hints`
224
+
225
+ Starting at the 0.12 release, the migration manifest schema is closed (`'+': 'reject'`) and the metadata model no longer carries `labels` or `hints`. Any on-disk `migration.json` that still holds either key fails to load: the loader rejects the manifest with `INVALID_MANIFEST`, naming the first offending key (`labels` or `hints`). The two fields are also removed from the content-addressed migration identity — `migrationHash` is now computed over `{ from, to, providedInvariants, createdAt }` plus the sibling `ops.json` — so every migrated manifest additionally needs its hash recomputed over the slimmed envelope, or it fails hash verification on the next load.
226
+
227
+ Run the colocated codemod from your project root:
228
+
229
+ ```bash
230
+ pnpm exec tsx ./strip-migration-labels-hints.ts
231
+ ```
232
+
233
+ It walks every `migration.json` that has a sibling `ops.json` (a complete on-disk migration package), removes the `labels` and `hints` keys, and recomputes `migrationHash` over the slimmed metadata plus the operations. The edit is format-preserving — only the two key lines are removed and the hash value is swapped in place, so the rest of each manifest (key order, indentation, inline-vs-expanded arrays) is left untouched and the diff stays minimal. The codemod is idempotent: re-running it over already-migrated manifests makes no further changes.
234
+
235
+ ### Confirm every manifest is migrated
236
+
237
+ Run the codemod in dry-run mode to confirm no manifest still carries the removed keys or a stale hash:
238
+
239
+ ```bash
240
+ pnpm exec tsx ./strip-migration-labels-hints.ts --check
241
+ ```
242
+
243
+ `--check` lists every manifest that still needs fixing and exits non-zero if any remain, so wire it into a pre-commit hook or CI step to keep stale manifests out of the tree. A fully migrated tree reports `0 needing fix` and exits `0`.
244
+
245
+ ### Validation
246
+
247
+ After running the codemod, exercise any command that loads your migrations (your deploy or migration-status step). The loader recomputes and verifies each manifest's `migrationHash` on read: a manifest that still carried `labels`/`hints` would have thrown `INVALID_MANIFEST`, and a manifest with a stale hash would fail verification. Once the codemod has run, every manifest loads cleanly and its recomputed hash verifies against the slimmed envelope.
248
+
249
+ ## `re-emit-closed-mongo-contracts`
250
+
251
+ Starting at the 0.12 release, MongoDB emits **closed** `$jsonSchema` validators by default. Every object schema in the emitted contract — collection validators, nested objects, and each branch of a polymorphic `oneOf` — carries `additionalProperties: false`. The contract canonicalizer also preserves `additionalProperties` through emission, so the on-disk migration for consumers is to re-emit their Mongo contracts and apply the resulting validator change to the database.
252
+
253
+ Two authoring constraints apply before emit succeeds:
254
+
255
+ - **Closed validators** land automatically on re-emit; no hand-editing of `contract.json` is required.
256
+ - **Non-variant models need an `objectId` `_id`**. The new interpret-time rule `PSL_MONGO_ID_REQUIRED` rejects any non-variant Mongo model whose `_id` field does not resolve to `objectId`. Fix the PSL or TS contract source first — for example, ensure `@id` is present and typed as MongoDB's default `ObjectId` — then re-emit.
257
+
258
+ ### Re-emit your Mongo contracts
259
+
260
+ Run the colocated script from your project root:
261
+
262
+ ```bash
263
+ pnpm exec tsx ./re-emit-closed-mongo-contracts.ts
264
+ ```
265
+
266
+ It finds every directory with a `prisma.config.ts` and a committed Mongo `contract.json`, then runs `pnpm emit` (or `prisma-next contract emit` when no emit script exists) in each. The regenerated `contract.json` / `contract.d.ts` pick up closed validators and an updated `storageHash`.
267
+
268
+ Use `--check` to list contracts that still need re-emitting without writing files:
269
+
270
+ ```bash
271
+ pnpm exec tsx ./re-emit-closed-mongo-contracts.ts --check
272
+ ```
273
+
274
+ ### Apply the validator migration
275
+
276
+ Re-emitting changes the contract's `$jsonSchema` shape. The planner classifies the open→closed validator tightening as **`destructive`** — MongoDB replaces collection validators, and documents with fields outside the closed schema will fail validation after apply.
277
+
278
+ Plan first to review the ops:
279
+
280
+ ```bash
281
+ pnpm prisma-next db update --plan-only
282
+ # or: prisma-next migration plan
283
+ ```
284
+
285
+ Then apply with explicit confirmation:
286
+
287
+ ```bash
288
+ pnpm prisma-next db update -y
289
+ ```
290
+
291
+ Wire `-y` into your deploy pipeline only after you have reviewed the plan in a lower environment. Without `-y`, apply refuses when destructive ops are present.
292
+
293
+ ### Validation
294
+
295
+ After re-emitting and applying, run `pnpm typecheck && pnpm test` (or your application's equivalent). Contract hash/type drift shows up immediately in TypeScript imports of `StorageHash`. At runtime, confirm `db verify` passes against the updated validators.
296
+
297
+ ## `public-default-namespace`
298
+
299
+ Starting at the 0.12 release, un-namespaced Postgres models resolve to the `public` namespace id instead of falling back to the `__unbound__` sentinel. The emitted contract's default storage namespace key changes from `__unbound__` with `"kind": "postgres-unbound-schema"` to `public` with `"kind": "postgres-schema"`. Domain roots, FK `namespaceId` fields, and `contract.d.ts` namespace literals follow the same rename.
300
+
301
+ Explicit opt-in to the sentinel remains available: `namespace unbound { … }` in PSL still round-trips to `__unbound__` on Postgres. Only contracts whose *default* namespace is still the old sentinel shape need this migration.
302
+
303
+ ### Re-emit Postgres contracts
304
+
305
+ Run the colocated script from your project root:
306
+
307
+ ```bash
308
+ pnpm exec tsx ./re-emit-postgres-public-default.ts
309
+ ```
310
+
311
+ It finds every committed `contract.json` whose storage tree still carries `"kind": "postgres-unbound-schema"`, then runs `pnpm emit` (or `prisma-next contract emit`) in the matching contract space. Use `--check` to list spaces that still need re-emitting without writing files:
312
+
313
+ ```bash
314
+ pnpm exec tsx ./re-emit-postgres-public-default.ts --check
315
+ ```
316
+
317
+ ### After re-emit
318
+
319
+ If your database marker or migration head still references the old contract hash, plan and apply the resulting migration (`prisma-next db update --plan-only`, then `prisma-next db update -y` once reviewed). The schema ops are typically hash/metadata drift only when your PSL source did not change.
320
+
321
+ ### Validation
322
+
323
+ After re-emitting, run `pnpm typecheck && pnpm test`. Inspect the `contract.json` diff: default models should sit under `storage.namespaces.public` and `domain.namespaces.public`, not `__unbound__`.
324
+
325
+ ## `domain-plane-namespaced-contract`
326
+
327
+ Starting at the 0.12 release, the application plane is symmetric with storage: models and value objects live under `contract.domain.namespaces.<ns>` instead of flat `contract.models` / `contract.valueObjects` at the contract root (ADR 221). Emitted `contract.d.ts` exports `Models` via `ContractModelsMap<Contract>` rather than `Contract['models']`.
328
+
329
+ ### Re-emit your contracts
330
+
331
+ Run the colocated script from your project root:
332
+
333
+ ```bash
334
+ pnpm exec tsx ./re-emit-domain-namespaced-contracts.ts
335
+ ```
336
+
337
+ It finds contract spaces whose on-disk artefacts still use the flat domain shape (JSON missing `domain.namespaces`, or `contract.d.ts` still referencing `Contract['models']`), then re-emits each space. Use `--check` for a dry-run:
338
+
339
+ ```bash
340
+ pnpm exec tsx ./re-emit-domain-namespaced-contracts.ts --check
341
+ ```
342
+
343
+ If you already re-emitted for `public-default-namespace` on 0.12, a single emit pass covers both transitions — run whichever entry's detection matches your tree.
344
+
345
+ ### Validation
346
+
347
+ After re-emitting, run `pnpm typecheck && pnpm test`. The regenerated `contract.json` should carry a `domain.namespaces` envelope; `contract.d.ts` should export a `Models` alias derived from the contract type (on current 0.12 builds this is typically `Contract extends ContractType<StorageBase, infer TModels> ? TModels : never`, not `ContractModelsMap`, which was removed with runtime default-namespace qualification — see `runtime-qualified-sql-default-namespace` below).
348
+
349
+ ## `runtime-qualified-sql-default-namespace`
350
+
351
+ Starting at the 0.12 release, runtime SQL on Postgres qualifies table identifiers with the storage namespace the flat DSL/ORM surface resolved ([ADR 223](../../../../docs/architecture%20docs/adrs/ADR%20223%20-%20Target-owned%20default%20namespace.md)). Un-namespaced Postgres models continue to resolve through the `public` default; explicit `namespace unbound { … }` in PSL still maps to `__unbound__`.
352
+
353
+ ### Application code
354
+
355
+ No change is required for normal query code:
356
+
357
+ ```ts
358
+ await db.sql.user.findMany();
359
+ await db.User.findMany();
360
+ ```
361
+
362
+ Bare names still resolve default-namespace-first; only the emitted SQL changes.
363
+
364
+ ### Tests and observability
365
+
366
+ If you assert raw SQL strings (integration tests, query logs, migration snapshots), expect qualified Postgres identifiers:
367
+
368
+ ```diff
369
+ -FROM "user"
370
+ +FROM "public"."user"
371
+ ```
372
+
373
+ SQLite and Mongo behaviour for bare names is unchanged at the SQL/collection string level (SQLite `qualifyTable` is a no-op; Mongo has no SQL-style qualification).
374
+
375
+ ### Contract artefacts
376
+
377
+ Re-emit (`pnpm emit` / `prisma-next contract emit`) is **not** required solely for this change when your PSL/contract source is already on the 0.12 namespaced shape. If you have not yet run the `domain-plane-namespaced-contract` or `public-default-namespace` transitions, complete those first — a single emit pass covers all on-disk contract updates.
378
+
379
+ ### Emitted types note
380
+
381
+ If you maintain hand-written code against generated `contract.d.ts`, replace any use of removed `ContractModelsMap<Contract>` with the emitted `Models` export or `ContractModelDefinitions<YourContract>` from `@internal/contract/types`. That removal affects extension authors directly; application projects that only import the generated `Models` alias pick up the new shape on re-emit.