model User {
id String @id @default(cuid())
name String?
email String? @unique
emailVerified DateTime?
image String?
accounts Account[]
sessions Session[]
following UserFollows[] @relation("follower")
followedBy UserFollows[] @relation("following")
}
model UserFollows {
follower User @relation("follower", fields: [followerId], references: [id])
followerId String
following User @relation("following", fields: [followingId], references: [id])
followingId String
@@id([followerId, followingId])
@@index([followerId])
@@index([followingId])
}
model User {
id String @id @default(cuid())
name String?
email String? @unique
emailVerified DateTime?
image String?
accounts Account[]
sessions Session[]
following UserFollows[] @relation("follower")
followedBy UserFollows[] @relation("following")
}
model UserFollows {
follower User @relation("follower", fields: [followerId], references: [id])
followerId String
following User @relation("following", fields: [followingId], references: [id])
followingId String
@@id([followerId, followingId])
@@index([followerId])
@@index([followingId])
}