## 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
([#30641](https://github.com/prisma/orm/pull/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
([#30641](https://github.com/prisma/orm/pull/30641)), because the
project's done conditions include that ADR, and after
[#30705](https://github.com/prisma/orm/pull/30705), which makes the code
match what ADR 267 says about a model with no fields.
## What the project delivered
| Slice | PR | Outcome |
|---|---|---|
| 1 | [#30665](https://github.com/prisma/orm/pull/30665) | A contract
definition can hold columns and tables no model maps, lowered by the
same code as a model's table. |
| 2 | [#30667](https://github.com/prisma/orm/pull/30667) | The SQL ORM
reads and writes only the columns a model's fields map; naming any other
column throws `ORM.FIELD_UNKNOWN`. |
| 3 | [#30672](https://github.com/prisma/orm/pull/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 | [#30671](https://github.com/prisma/orm/pull/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:
[#30641](https://github.com/prisma/orm/pull/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
[#30705](https://github.com/prisma/orm/pull/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 <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>