Skip to content

Code Layout fix + small logical error - #872

Merged
mhwelander merged 3 commits into
prisma:masterfrom
rahul3v:fix-layout+errors
Oct 5, 2020
Merged

Code Layout fix + small logical error#872
mhwelander merged 3 commits into
prisma:masterfrom
rahul3v:fix-layout+errors

Conversation

@rahul3v

@rahul3v rahul3v commented Sep 23, 2020

Copy link
Copy Markdown
Contributor

Need to update Prisma-examples as well

Need to update Prisma-examples as well
well as per example, it was ok,
As  '-' is used to highlight  delete lines
@mhwelander
mhwelander merged commit 3339116 into prisma:master Oct 5, 2020
@mhwelander

Copy link
Copy Markdown
Contributor

馃

ankur-arch added a commit that referenced this pull request Jul 7, 2026
* docs(orm/next): add data modeling guides

Add a data modeling section under Prisma Next docs with three pages:

- Overview: models, primary keys (how to pick), scalar fields (how to
  pick a type), and relations
- Relational databases: 1:1, 1:n, m:n (implicit + explicit), and
  polymorphic relations, plus foreign-key ownership guidance
- MongoDB: documents, embed-vs-reference, references, and polymorphic
  collections

Register the section in the Next nav.

Note: relation snippets use the in-flight directional `@relation(from:, to:)`
syntax and implicit m:n from the unmerged PSL relation-syntax stack
(prisma/prisma-next #872-876); verify before publishing.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* docs(orm/next): drop MongoDB many-to-many section

Remove the many-to-many modeling content from the MongoDB guide entirely.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* 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>

* docs(skill): record the house guide style for hands-on pages

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* docs(data-modeling): note explicit discriminator on variant creates (live-tested)

Verified against a fresh Prisma Postgres database: variant ORM roots
exist and base queries return variant rows, but creating through a
variant does not auto-fill the discriminator on 0.14.0.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* docs(data-modeling): sidebar as a Data Modeling section with Overview first

Sidebar now reads Data Modeling > Overview / Relational data modeling /
MongoDB data modeling, per review.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Ankur Datta <64993082+ankur-arch@users.noreply.github.com>
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