From 0b1ad42097dc13024191b08c7159b155a8d8c65d Mon Sep 17 00:00:00 2001 From: Philly Cai Date: Mon, 8 Dec 2025 02:55:34 +0800 Subject: [PATCH 1/3] fix(overview): author & authorId cannot be optional --- content/200-orm/100-prisma-schema/10-overview/index.mdx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/content/200-orm/100-prisma-schema/10-overview/index.mdx b/content/200-orm/100-prisma-schema/10-overview/index.mdx index 462d421657..0a68988dfe 100644 --- a/content/200-orm/100-prisma-schema/10-overview/index.mdx +++ b/content/200-orm/100-prisma-schema/10-overview/index.mdx @@ -59,8 +59,8 @@ model Post { updatedAt DateTime @updatedAt published Boolean @default(false) title String @db.VarChar(255) - author User? @relation(fields: [authorId], references: [id]) - authorId Int? + author User @relation(fields: [authorId], references: [id]) + authorId Int } enum Role { @@ -97,7 +97,7 @@ model Post { updatedAt DateTime @updatedAt published Boolean @default(false) title String - author User? @relation(fields: [authorId], references: [id]) + author User @relation(fields: [authorId], references: [id]) authorId String @db.ObjectId } From 8dcdff28281f2934c8a1355f428e22a47fea647b Mon Sep 17 00:00:00 2001 From: Philly Cai Date: Sun, 7 Dec 2025 14:05:07 +0800 Subject: [PATCH 2/3] fix(data-model): post & postId cannot be optional --- .../100-prisma-schema/20-data-model/10-models.mdx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/content/200-orm/100-prisma-schema/20-data-model/10-models.mdx b/content/200-orm/100-prisma-schema/20-data-model/10-models.mdx index 381faa1962..f12090e1c4 100644 --- a/content/200-orm/100-prisma-schema/20-data-model/10-models.mdx +++ b/content/200-orm/100-prisma-schema/20-data-model/10-models.mdx @@ -407,8 +407,8 @@ model Comment { id Int // Other fields //highlight-next-line - post Post? @relation(fields: [postId], references: [id]) // A comment can have one post - postId Int? + post Post @relation(fields: [postId], references: [id]) // A comment can have one post + postId Int } ``` @@ -424,11 +424,11 @@ model Post { } model Comment { - id String @id @default(auto()) @map("_id") @db.Objectid + id String @id @default(auto()) @map("_id") @db.Objectid // Other fields //highlight-next-line - post Post? @relation(fields: [postId], references: [id]) // A comment can have one post - postId String? @db.ObjectId + post Post @relation(fields: [postId], references: [id]) // A comment can have one post + postId String @db.ObjectId } ``` From 022194bcc1c81b5bb4232bdcee4af381749ee635 Mon Sep 17 00:00:00 2001 From: Philly Cai Date: Sun, 7 Dec 2025 22:35:03 +0800 Subject: [PATCH 3/3] fix(indexes): update inline comment placements --- .../200-orm/100-prisma-schema/20-data-model/30-indexes.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/200-orm/100-prisma-schema/20-data-model/30-indexes.mdx b/content/200-orm/100-prisma-schema/20-data-model/30-indexes.mdx index b1891cbe30..b8b8911997 100644 --- a/content/200-orm/100-prisma-schema/20-data-model/30-indexes.mdx +++ b/content/200-orm/100-prisma-schema/20-data-model/30-indexes.mdx @@ -202,9 +202,9 @@ model Example { id Int @id value Json // ^ field type matching the operator class - // ^ operator class ^ index type @@index([value(ops: JsonbPathOps)], type: Gin) + // ^ operator class ^ index type } ``` @@ -340,9 +340,9 @@ model Example { id Int @id value Int // ^ field type matching the operator class - // ^ operator class ^ index type @@index([value(ops: Int4BloomOps)], type: Brin) + // ^ operator class ^ index type } ```