Skip to content

TML-3467: The Prisma 7 reader keeps the columns and tables @ignore hides - #30672

Merged
wmadden-electric merged 55 commits into
mainfrom
tml-3467-prisma7-ignore-keeps-storage
Oct 9, 2026
Merged

wmadden-electric merged 55 commits into
mainfrom
tml-3467-prisma7-ignore-keeps-storage

Conversation

@wmadden-electric

@wmadden-electric wmadden-electric commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

At a glance

model User {
  id         Int        @id
  email      String     @unique
  legacy_key String?    @ignore
  audits     AuditRow[] @ignore
}

model AuditRow {
  id     Int  @id
  userId Int
  user   User @relation(fields: [userId], references: [id])

  @@map("audit_rows")
  @@ignore
}

Before: the contract read from this Prisma 7 schema had no legacy_key column, no audit_rows table and no foreign key from it. So it described a different database from the one Prisma 7 built.

After: the contract's storage has User with id, email and legacy_key, and audit_rows with its primary key and its foreign key to User. The domain has model User with id and email only. In the handover example, adding these @ignore attributes after Prisma 8 has taken over migrations plans nothing, and so does removing them.

The decision

The Prisma 7 reader describes exactly what the schema says the database holds, or refuses (ADR 252). @ignore and @@ignore hide a field or model from Prisma 7's client, not from its database, so the reader now keeps them as storage:

  • An @ignore scalar field becomes a column node on its model's table, with its type, nullability and column default. It gets no execution default (uuid(), cuid(), @updatedAt and similar), because the ORM never writes the column. A required column with no default triggers the existing PN_COLUMN_REQUIRED_UNMAPPED warning.
  • A unique or index over an ignored field is kept. A primary key over one is refused with PSL.PRISMA7_IGNORED_FIELD_REFERENCED, because the model would have no field that identifies a row.
  • An @ignore relation field keeps its foreign key. A relation that is not ignored but joins on an ignored field stays refused.
  • An @@ignore model becomes a table node with its columns, keys, indexes and foreign keys. Foreign keys to and from it target the other table by model when it has one, and by table name when it does not.
  • An implicit many-to-many junction with an ignored side is kept as a table node, not a model, because no relation reaches it.

The table node and the column node come from ADR 267 (#30641). The ORM changes that keep queries to a model's own fields are in #30667.

What can now be refused

  • A column with no Prisma 8 codec is refused, ignored or not. Before, the reader's messages offered @ignore or @@ignore as a way around a missing codec. That is no longer true, and the messages no longer say so.
  • Ignored objects now meet every rule of the reader. For example, an @@ignore model with @@index([at(sort: Desc)]), or an ignored Json field with @default("null"), is now refused. Before, it loaded only because the object was dropped. The upgrade instruction lists the diagnostics.

Upgrading a signed project

A project that uses @ignore and signed with an earlier Prisma 8 gets a new storage hash.

  • While Prisma 7 owns migrations: prisma contract emit, then prisma db sign.
  • After the handover: prisma contract emit, then prisma migration plan, then bring each existing database to the new hash with prisma db sign or prisma db migrate --advance-ref db. Signing before planning makes the next plan fail with MIGRATION.HASH_NOT_IN_GRAPH; migration plan --from <previous hash> recovers.

The instruction is upgrade-instructions/pending/prisma7-ignore-keeps-storage/app/instructions.md.

How it is proven

  • Reader fixtures: ignored-field-defaults, ignored-field-in-index, ignored-relation-field, ignored-models, ignored-model-many-to-many and others hold the expected contract; ignored-field-no-codec, ignored-field-in-primary-key and ignored-objects-meet-every-rule hold the expected refusals. Each fixture schema validates with Prisma 7.10.0.
  • examples/prisma7-adoption/test/handover.test.ts: after the handover, adding @ignore and @@ignore plans nothing with the storage hash unchanged, and removing them does too; Prisma 7's migrate diff is empty for both edits.
  • examples/prisma7-adoption/test/upgrade-ignore.test.ts: four upgrade paths (sign; migrate --advance-ref db; plain migrate then sign; sign first, then recover with --from). Each ends with verify finding nothing and the next plan empty.
  • Strict verify on every success fixture in interpreter-fixtures.integration.test.ts reports no ignored object as unclaimed.

Not in this PR

Alternatives considered

  • Keep dropping ignored objects. The contract would describe a different database, and a later Prisma 8 migration could drop real columns and tables.
  • Keep ignored columns that have no codec, with an opaque type. Every storage column carries a codec. Supporting columns without one is its own decision, so the reader refuses them for now.

Project: Storage a model does not map. Closes TML-3467 and TML-3462.

Agent: anansi-36

Summary by CodeRabbit

  • New Features
    • Prisma 7 contracts now retain storage for ignored fields, models, relations, and many-to-many junctions, including defaults, indexes, and foreign keys.
    • Added upgrade guidance for schemas using @ignore or @@ignore, covering migration planning and database signing.
  • Bug Fixes
    • Clarified diagnostics for unsupported column types and ignored fields used in primary keys or non-ignored relations.
    • Strict verification now reports no extra findings for supported ignored constructs.
  • Known Limitations
    • Contract printing is refused when ignored storage cannot be represented in the printed schema.

Project spec, plan and design notes for P-TML-1151, and the spec for slice 1 (TML-3468).

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
… its tables

Each model is converted on its own into a table description (column descriptions, primary key, uniques, indexes, checks, resolved foreign keys, control policy) and its domain model. A single-table variant adds its columns to its base's table. The tables are then merged per namespace and table name, and one column lowering and one table lowering run over them before the contract is assembled as before. build-contract.ts is split into modules for each step.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
… refuse a variant column its base table lacks

A column's site is now a field of a model or a column of a table, and one helper gives the message subject and error metadata for both; messages for fields are unchanged. resolveForeignKey takes the source table and an owner name instead of a model. mergeTables refuses a single-table variant column that is not on its base table (CONTRACT.COLUMN_ON_STI_VARIANT) instead of adding it. Tests cover the merge and the namespace a relation to a shared model name resolves to.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
ContractDefinition gains tables: table nodes made of column nodes, a primary key, uniques, indexes, checks, foreign keys and a control policy. A column node is a field node without its field part, and FieldNode is now a column node plus that part. A foreign key may name its target table instead of a model. A table node for a modelled table adds only columns; one for any other table is a whole table. Both lower through the same column and table lowering as a model's table. Refused: a column declared by a field and a column node, table-level properties on a modelled table (CONTRACT.TABLE_OWNED_BY_MODEL), two table nodes for one table, and a foreign key to an undeclared table (CONTRACT.TABLE_UNKNOWN). The equation matrix shows each column kind lowers the same as a column node as it does as a field.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
The enum handle decides the column's storage value set and its membership check, so it moves from the field part onto ColumnNode; FieldNode still has it. The equation matrix gains an enumType() row with whole-storage equality, replacing the two tests that showed the gap. A column a table node lists twice is now reported as listed twice by its table node.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
Record the stage boundary as built, the enum handle on the column node, the variant refusals, the intended differences from main, and the items deferred from review.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…pes and names

lowerTable emits a table's checks sorted by name, the order canonicalization uses, so moving a field from the middle of a model to a column node leaves the in-memory storage equal. A table node may not declare a column a single-table variant's field maps; the error names the variant field. An omitted or empty namespace means the default namespace for models, table nodes and table-targeted foreign keys alike. FieldNode extends ScalarMemberNode and ColumnNode; ValueObjectFieldNode takes its column part from ColumnNode; ModelNode and TableNode share TableProperties, which the table-owned-by-model check reads. One name per concept across both stages (enumTypeHandle, id). Column sites and foreign-key owners use one split, and a table node is named with its namespace. CONTRACT.COLUMN_ON_STI_VARIANT is renamed CONTRACT.VARIANT_COLUMN_NOT_ON_BASE_TABLE. The new node types are exported, and DEVELOPING.md describes the two stages.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
compareCodeUnits is exported from @internal/contract/hashing-utils, and lowerTable sorts checks with it instead of a local copy.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
QA found the CONTRACT.TABLE_UNKNOWN message stated the problem without the fix. Also correct a column descriptor name in the slice spec example.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…el's namespace

The model branch kept an empty namespaceId as the target namespace, so the foreign key pointed at a namespace that does not exist. It now uses the same rule as the table branch.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…s only from them

getModelFields lists a model's own and inherited fields, and resolveFieldColumn refuses any name that is not a field of the model or of the variant in scope with ORM.FIELD_UNKNOWN (Model "<model>" has no field "<name>"). where shorthand and callbacks, orderBy, select, distinct, distinctOn, groupBy, cursor, aggregates, having, create, update and upsert data, single-table and multi-table variant creates, conflictOn, include nested select and scalar reducers, relation filters, relation join fields and fragments all resolve through it; nothing falls back to treating a name as a column. Row mapping drops any column no field maps, and a model with no fields maps to an empty row. A column the ORM picks itself, such as a key column, maps back to its field strictly.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…ts only the fields its type offers

Relation lookups by a caller's name use Object.hasOwn, so Object.prototype members are never relations. The where/orderBy accessor returns undefined for then and toJSON and the plain-object value for Object.prototype members, after fields and relations, and refuses every other unknown name. It accepts the model's own and inherited fields plus the narrowed variant's; select alone still accepts every variant's fields on an unnarrowed collection. A field whose column is missing from its table is an internal error. update() checks its data with assertModelFieldNames. The ORM.FIELD_UNKNOWN reference entry lists every surface.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
The test for a field named then now declares that field with defineContract instead of patching contract data. The test for a relation that names a column as its join field is removed: no authoring surface produces that shape, and the build will refuse it.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
resolveModelColumns gives the columns a query on a model reads from a table: its own and inherited fields on that table, its variants' fields there, and on a multi-table variant's table the inherited key. The default projection (top level, include children, include distinct inner and outer), RETURNING, multi-table variant joins, include binding keys and the default include nested select use it instead of every column of the table. compileSelect and the RETURNING compilers take the model. An integration test builds a contract whose tables hold columns no field maps, through table nodes, and shows they are never read and cannot be named.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
No source can build a polymorphic contract with an extra column yet.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…nt's

The top-level projection uses the pinned variant as its model, and include children and their binding keys use the include's pinned variant. A collection pinned to one single-table variant no longer reads a sibling variant's columns.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
Relation lowering refuses a join column no field of its model maps (CONTRACT.RELATION_INVALID, reason join-column-not-a-field) instead of passing the column name through as a field name; the target side of a many-to-many relation names junction columns and is exempt. The SQL contract validators refuse a domain field with no storage entry and an execution default on a column no field maps. The build warns (PN_COLUMN_REQUIRED_UNMAPPED) when a table some model maps holds a required column with no default that no field maps, since every ORM insert into it fails.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
The hydration test leaves the field out of the domain as well as storage. The two printer refusal tests now pin that the contract is refused when it is read, before the printer sees it.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
validateSqlContractFully refuses a domain field with no storage entry and an execution default on a column no field maps before contract print sees the contract, so refuseFieldsWithoutColumn and refuseUnwrittenExecutionDefaults could no longer run. They are removed with the writtenExecutionDefaults set only they read, and the two matching CONTRACT.PRINT_UNSUPPORTED bullets leave the error reference.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
The extension fragment states that every surface refuses a name that is not a field with ORM.FIELD_UNKNOWN, and that conflictOn now raises ORM.FIELD_UNKNOWN instead of ORM.ARGUMENT_INVALID. The error reference describes the current behaviour only.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
validateRelationJoinFields checks every relation's local fields against its model and its target fields against the target model, own and inherited; the target side of a many-to-many relation (junction columns) and a cross-space target are not checked. A contract loaded from JSON is refused the same way the build refuses it. The execution-default validator now gives its reason as execution defaults belonging to fields. Two family-sql test contracts that joined on names that were not fields are corrected, and the hydration test whose local join field had no column now expects the refusal.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
… where it comes from

The field-to-column maps are getOwnFieldColumns, getModelFieldColumns, getModelAndVariantFieldColumns and getModelAndEveryVariantFieldColumns, with getOwnColumnFields and getModelColumnFields the other way; one FieldColumn type replaces two. columnOfCallerField refuses a name a caller passed with ORM.FIELD_UNKNOWN; columnOfContractField and fieldOfColumn resolve names the contract or the ORM chose and raise an internal error, which a relation join field now does since the contract validators refuse an unmapped one. getColumnsReadOnTable sits beside the other field functions on the shared cachedFor cache, and the variant placement rule is written once on getModelAndVariantFieldColumns. A multi-table variant create reuses that map; errors on a narrowed select or accessor name the variant; compileSelect takes the model before the table like the mutation compilers. Relation shorthand filters check names before reading the accessor, an unnarrowed select of a field two variants map to different columns reads both, and fragments see inherited fields. The warning sink pattern doc and the contract-ts README list PN_COLUMN_REQUIRED_UNMAPPED.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…ation, and record the upgrade for applications

The cross-space branch of relation lowering now resolves its local join columns through joinFieldOf, before its nullability check, so an unmapped column is refused at build time with the join message instead of failing later. The app audience gets the same upgrade instruction as the extension audience.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
When the refused name is the column of a field of the model, the ORM.FIELD_UNKNOWN message names that field and the payload carries it as fieldForColumn. When the name is a column of the model's tables that no field maps, the message says the ORM cannot read or write it. Otherwise the message is unchanged.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
The column can be on a variant's table rather than the table of the model the caller addressed, so the ORM.FIELD_UNKNOWN hint now names the table.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…ide when reading a Prisma 7 schema

An @@ignore model becomes a table with no model: its columns, keys, indexes and foreign keys. Foreign keys reach its table by name. An implicit many-to-many junction with an @ignore list field or an @@ignore model on either side is kept as a table with no model. Column types with no Prisma 8 codec are refused inside @@ignore models too, and an @@ignore model's table collides with another model's like any table.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…cross schemas

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…ject upgrades

The handover test marks a field @ignore and a model @@ignore and removes them again: the storage hash stays, migration plan reports no changes, and Prisma 7 sees no drift. A new test upgrades a project signed without the ignored objects: it plans a migration that records them, signs again with no findings, migrates nothing, and then plans nothing. The upgrade instruction tells Prisma 7 projects that use @ignore to do the same. The planner golden manifest and the reader docs follow.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
… paths as they really behave

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
… refusals and names

The upgrade instruction names the refusals ignored objects can now meet and gives both ways to bring each existing database to the new hash after the handover, plus the recovery from signing first; the upgrade test proves all three. The primary-key refusal gives its reason and both fixes. ignoredFields holds only fields marked @ignore, ignored junctions are built as tables first, and the names say ignored. New fixtures pin an @@ignore model with a sort argument, an ignored JSON null default and an ignored relation with SetNull over a required field. The READMEs drop the advice to ignore codec-less columns and say contract print refuses ignored storage for now.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…the primary-key refusal's reason in the Prisma 7 source spec

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…fusal list, and plain migrate then sign

The primary-key refusal says Prisma 7 requires @ignore on every relation field pointing to a model marked @@ignore. The upgrade instruction lists only refusals that are new, as examples. The upgrade test proves plain db migrate leaves the db ref behind and db sign then catches it up, and the example README describes all four cases.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
@wmadden-electric
wmadden-electric requested a review from a team as a code owner October 9, 2026 10:40
@coderabbitai

coderabbitai Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: prisma/orm/.coderabbit.yml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 61cd7c8f-00e3-409c-b405-9102975e2691

📥 Commits

Reviewing files that changed from the base of the PR and between 39f4d19 and 38fcbd5.


⛔ Files ignored due to path filters (4)
  • projects/prisma7-contract-source/slices/01-postgres-source/spec.md is excluded by !projects/**
  • projects/prisma7-contract-source/spec.md is excluded by !projects/**
  • projects/unmapped-storage/plan.md is excluded by !projects/**
  • projects/unmapped-storage/slices/03-prisma7-ignore-keeps-storage/spec.md is excluded by !projects/**

📒 Files selected for processing (1)
  • examples/prisma7-adoption/test/handover.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.



📝 Walkthrough

Walkthrough

Prisma 7 interpretation now retains ignored fields, models, relations, and many-to-many junctions in SQL storage while excluding ignored objects from domain models. Diagnostics, tests, documentation, adoption examples, and upgrade instructions reflect the revised storage and migration behavior.

Changes

Prisma 7 ignored-storage behavior

Layer / File(s) Summary
Retain ignored objects in storage
packages/2-sql/2-authoring/contract-prisma7/src/*, packages/2-sql/2-authoring/contract-prisma7/README.md, docs/reference/error-reference.md, packages/3-extensions/postgres/README.md
The interpreter and relation lowering retain ignored fields and models as storage, including foreign keys and ignored-side junction tables. Updated diagnostics cover ignored primary-key fields, non-ignored relations that reference ignored fields, and unsupported types.
Verify retained storage and diagnostics
packages/2-sql/2-authoring/contract-prisma7/test/*, packages/2-sql/2-authoring/contract-prisma7/test/fixtures/*
Added fixtures and tests for ignored columns, defaults, indexes, relations, models, and junctions. Expected contracts and diagnostics reflect retained storage and updated validation rules.
Update integration expectations
test/integration/test/planner-golden/manifest.json, test/integration/test/prisma7-source/*, test/integration/test/psl-print/*, test/integration/test/cli-journeys/*
Integration tests update storage hashes, foreign-key expectations, strict-verification results, and schema-print refusal behavior.
Document and test upgrade workflows
examples/prisma7-adoption/*, upgrade-instructions/pending/prisma7-ignore-keeps-storage/*
Adoption tests cover ignored-schema edits and upgrade scenarios for signing, migration, reference advancement, and recovery. The instructions describe the corresponding upgrade steps.

Priority: ➖ Normal

Estimated code review effort: 4 (Complex) | ~45 minutes

Change: Feature

Suggested reviewers: aqrln, tensordream


Merge Risk

Merge Risk: ⚪ Minimal · up to 38fcb

The reviewed changes preserve ignored database storage while keeping ignored objects out of the domain. No actionable merge-blocking risk was identified.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 38fcb

Ignored objects remain outside ORM access, but migration tooling now recognizes their database storage. The main risk is upgrade compatibility: existing projects may need to reconcile contract hashes and migration history, and contracts containing ignored storage cannot yet be printed as Prisma 8 schemas.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — Schema-controlled ignored objects now influence storage columns, tables, indexes, keys, and foreign keys consumed by migration tooling. Their effective reach therefore follows the database authority of the consuming workflow; the inspected evidence does not establish additional service, tenant, credential, or environment exposure.

Trust Boundaries and Controls

  • observed — Retained storage passes through the existing contract builder, SQL specifier control policy, and domain/storage/reference validation before the provider returns a contract. Ignored objects remain outside domain fields, models, and relations. These controls support the representation boundary but do not independently prove downstream database authorization or execution safety.

Resilience and Maintainability Implications

  • observed — The routed helper edits test schema files, emits a contract, plans, and verifies; it does not invoke migration or signing. Temporary-directory cleanup is placed in an outer finally block, while database cleanup is delegated to the test utility. This test change does not add production transition authority, but interrupted database cleanup and immediate reference invariance were not independently verified.



🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 34.29% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 35 functions across 16 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and specifically summarizes the main change: Prisma 7 retains columns and tables hidden by @ignore.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.


  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR

🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR


  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@pkg-pr-new

pkg-pr-new Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@prisma/orm-extension-arktype-json

npm i https://pkg.pr.new/@prisma/orm-extension-arktype-json@30672

@prisma/orm-extension-middleware-cache

npm i https://pkg.pr.new/@prisma/orm-extension-middleware-cache@30672

@prisma/orm-extension-paradedb

npm i https://pkg.pr.new/@prisma/orm-extension-paradedb@30672

@prisma/orm-extension-pgvector

npm i https://pkg.pr.new/@prisma/orm-extension-pgvector@30672

@prisma/orm-extension-postgis

npm i https://pkg.pr.new/@prisma/orm-extension-postgis@30672

@prisma/orm-extension-supabase

npm i https://pkg.pr.new/@prisma/orm-extension-supabase@30672

@prisma/orm-family-mongo

npm i https://pkg.pr.new/@prisma/orm-family-mongo@30672

@prisma/orm-family-sql

npm i https://pkg.pr.new/@prisma/orm-family-sql@30672

@prisma/orm-framework

npm i https://pkg.pr.new/@prisma/orm-framework@30672

@prisma/orm-mongo

npm i https://pkg.pr.new/@prisma/orm-mongo@30672

@prisma/orm-postgres

npm i https://pkg.pr.new/@prisma/orm-postgres@30672

@prisma/orm-sqlite

npm i https://pkg.pr.new/@prisma/orm-sqlite@30672

@prisma/orm-target-mongo

npm i https://pkg.pr.new/@prisma/orm-target-mongo@30672

@prisma/orm-target-postgres

npm i https://pkg.pr.new/@prisma/orm-target-postgres@30672

@prisma/orm-target-sqlite

npm i https://pkg.pr.new/@prisma/orm-target-sqlite@30672

@prisma/orm-toolchain

npm i https://pkg.pr.new/@prisma/orm-toolchain@30672

commit: 38fcbd5

@github-actions

github-actions Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size
postgres / no-emit 240.63 KB (0%)
postgres / emit 212.16 KB (0%)
mongo / no-emit 199.35 KB (0%)
mongo / emit 177.2 KB (0%)
cf-worker / no-emit 300.35 KB (0%)
cf-worker / emit 268.53 KB (0%)

Base automatically changed from tml-3532-orm-stays-in-the-domain to main October 9, 2026 12:31
…-prisma7-ignore-keeps-storage

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>

# Conflicts:
#	projects/unmapped-storage/design-notes.md
#	projects/unmapped-storage/plan.md
@wmadden-electric
wmadden-electric added this pull request to the merge queue Oct 9, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 9, 2026
… print and Prisma 7 journeys

The round-trip test lists the Prisma 7 fixtures with ignored storage as print refusals until TML-3469. The Prisma 7 journey expects LegacyThing and no strict findings for ignored storage. The print journey prints the fixtures with their ignored fields and models removed, and checks that print refuses the schema as it is.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…-prisma7-ignore-keeps-storage

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>

# Conflicts:
#	examples/prisma7-adoption/test/handover.test.ts
…ed, now that the ledger is not reported

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
@wmadden-electric
wmadden-electric added this pull request to the merge queue Oct 9, 2026
Merged via the queue into main with commit 6e12cc2 Oct 9, 2026
24 checks passed
@wmadden-electric
wmadden-electric deleted the tml-3467-prisma7-ignore-keeps-storage branch October 9, 2026 16:52
opensource-fork-sync Bot pushed a commit to cla7aye15I4nd/opensource-prisma__orm that referenced this pull request Oct 13, 2026
## At a glance

This PR removes `projects/unmapped-storage/`, the planning files of the
project "Storage a model does not map". Its four slices have merged, and
its decisions live in ADR 267
([prisma#30641](prisma#30641)). It also corrects
one stale phrase in the Prisma 7 source project's slice 1 spec: an
`@ignore` field used by an index is now kept, not refused.

Merge this after ADR 267
([prisma#30641](prisma#30641)), because the
project's done conditions include that ADR, and after
[prisma#30705](prisma#30705), which makes the code
match what ADR 267 says about a model with no fields.

## What the project delivered

| Slice | PR | Outcome |
|---|---|---|
| 1 | [prisma#30665](prisma#30665) | A contract
definition can hold columns and tables no model maps, lowered by the
same code as a model's table. |
| 2 | [prisma#30667](prisma#30667) | The SQL ORM
reads and writes only the columns a model's fields map; naming any other
column throws `ORM.FIELD_UNKNOWN`. |
| 3 | [prisma#30672](prisma#30672) | The Prisma 7
reader keeps `@ignore` fields and `@@ignore` models as columns and
tables, so adding or removing `@ignore` after the handover plans
nothing. |
| 4 | [prisma#30671](prisma#30671) | Prisma 7's
`_prisma_migrations` table is left out of introspection, so `db verify
--strict` passes on a database Prisma 7 built. |

## Done conditions

- Adding `@ignore` to a field and `@@ignore` to a model in
`examples/prisma7-adoption` plans no operations, and so does removing
them. Met: `examples/prisma7-adoption/test/handover.test.ts`.
- The handover test asserts strict verify reports nothing unclaimed.
Met: same file, after every edit.
- `findMany()` with no `select` returns no extra column, and `create`
with its name throws `ORM.FIELD_UNKNOWN`. Met:
`test/integration/test/sql-orm-client/unmapped-storage.test.ts`.
- ADR 267 is merged. Open:
[prisma#30641](prisma#30641) awaits review.
- The Prisma 7 project's slice 1 text no longer says ignored objects are
omitted. Met by slice 3, plus the phrase corrected here.

## Where the deferred items went

- Many-to-many `on.targetFields` holds junction column names: TML-3570.
- Whether validator tests may build malformed contracts by hand:
TML-3571.
- A model with no fields types its rows as accepting any key: fixed in
[prisma#30705](prisma#30705) (TML-3536), because
ADR 267 states the fixed behaviour. Its review found TML-3572 (the SQL
ORM builds inputs from the row type), TML-3573 (Mongo contracts built
without emitting) and TML-3574 (other empty maps in emitted types).
- Prisma 8 syntax for unmapped columns and tables, the polymorphic
integration test, and rebuilding `buildMixedPolyContract` through a
source: TML-3469.
- A relation to a bare model name used in two namespaces resolves by
list order: TML-3280.
- A junction declared only by a table node is refused: kept as designed,
per ADR 267.
- A cross-space foreign key carries the target model's name as well as
its table: checked and kept; the name is real information about the
target (TML-3569, cancelled).

## Retro

- **Every path an upgrade instruction describes needs a test.** The
slice 3 spec first described the post-handover upgrade order wrongly,
then claimed migrating was unsafe. Tests for each path (sign, `migrate
--advance-ref db`, migrate then sign, sign-first recovery) showed the
real behaviour, and the instruction and ADR were corrected from them.
- **Run the cross-cutting test families on a merge of main before
queueing.** Slices 2 and 3 each left the merge queue once. Tests on main
had changed or been added after the PR's own CI: ported `_count` tests
for slice 2, and print refusals plus Prisma 7 journeys for slice 3.
Running the print round-trip and Prisma 7 CLI journey files after
merging main would have caught both.
- **After merging a sibling slice, run the shared test file even when
git merges it cleanly.** Slices 3 and 4 both edited `handover.test.ts`.
The merge was clean apart from one comment, but left a call to a helper
slice 4 had renamed.
- **Approved means queue it at once.** Slice 2 sat approved but not
queued for hours.

Project: [Storage a model does not
map](https://linear.app/prisma-company/project/storage-a-model-does-not-map-97488a1828eb).

Agent: anansi-36

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants