feat: implement user follow system

This commit is contained in:
Aaron William Po
2023-11-12 17:32:43 -05:00
parent d48d9a8886
commit 24e245fc6f
5 changed files with 88 additions and 0 deletions

View File

@@ -44,6 +44,18 @@ model User {
beerStyleLikes BeerStyleLike[]
beerStyleComments BeerStyleComment[]
userAvatar UserAvatar?
followedBy UserFollow[] @relation("following")
following UserFollow[] @relation("follower")
}
model UserFollow {
follower User @relation("follower", fields: [followerId], references: [id])
followerId String
following User @relation("following", fields: [followingId], references: [id])
followingId String
followedAt DateTime @default(now()) @db.Timestamptz(3)
@@id([followerId, followingId])
}
model UserAvatar {