Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions content/200-orm/100-prisma-schema/10-overview/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
}

Expand Down
10 changes: 5 additions & 5 deletions content/200-orm/100-prisma-schema/20-data-model/10-models.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
```

Expand All @@ -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
}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
```

Expand Down Expand Up @@ -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
}
```

Expand Down
Loading