Skip to content

Commit

Permalink
Update 400-self-relations.mdx
Browse files Browse the repository at this point in the history
improvement for: #4472
  • Loading branch information
nikolasburk authored Nov 16, 2023
1 parent 5ba41ca commit abf0118
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -321,17 +321,17 @@ If you need the relation to hold other fields, you can create an [explicit](many
model User {
id Int @id @default(autoincrement())
name String?
followedBy Follows[] @relation("following")
following Follows[] @relation("follower")
followedBy Follows[] @relation("followedBy")
following Follows[] @relation("following")
}
model Follows {
follower User @relation("follower", fields: [followerId], references: [id])
followerId Int
following User @relation("following", fields: [followingId], references: [id])
followingId Int
followedBy User @relation("followedBy", fields: [followedById], references: [id])
followedById Int
following User @relation("following", fields: [followingId], references: [id])
followingId Int
@@id([followerId, followingId])
@@id([followingId, followedById])
}
```

Expand Down

0 comments on commit abf0118

Please sign in to comment.