Commit b436d39
docs(data-modeling): plain language, tested syntax, structured key guidance
Revision per review feedback, with every schema snippet emit-tested
against @prisma-next 0.14.0 (PostgreSQL app + MongoDB app):
- Rewrite intros in plain language: idea first, blog example second,
terms last. Remove all em dashes. The docs-writer skill gains a
"Teach in plain language" section codifying this for other PRs.
- Fix syntax that the published packages reject:
@relation(from:, to:) does not exist (unsupported argument on 0.14.0
and on main, which accepts fields/references/map/onDelete/onUpdate),
so all examples use @relation(fields:, references:). Implicit
many-to-many and @relation(through:) are also rejected ("use an
explicit join model"), so the m:n section now teaches the explicit
junction model as the working pattern and names the implicit form as
not supported yet. Verified as PASS: composite @@id junctions,
@@discriminator/@@base (both layouts, SQL and Mongo), Mongo type
blocks (single + list), uuid()/autoincrement defaults.
- Fix broken rendering: bare (1:1) / (1:n) / (m:n) were parsed as
remark directives and rendered as "(1\n)". Now backticked; verified
intact in rendered HTML.
- Break dense guidance into scannable subsections with code blocks:
natural vs surrogate keys (Country ISO example, User/Product with
@unique), surrogate type choice, data type choice (zip/priceCents/
publishedAt examples), and "Which side owns the foreign key" as an
assertive checklist.
- MongoDB shown explicitly with tab switchers where it differs
(primary keys), cross-links to Fundamentals for querying each shape,
"Prompt your coding agent" sections, direct link phrasing.
- Park the DR-8679 redirect map, commented out, in next.config.mjs
under the shared "Prisma Next URL cutover (DR-8687)" block.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>1 parent 8878659 commit b436d39
5 files changed
Lines changed: 358 additions & 180 deletions
File tree
- .claude/skills/docs-writer
- apps/docs
- content/docs/orm/next/data-modeling
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
121 | 141 | | |
122 | 142 | | |
123 | 143 | | |
| |||
0 commit comments