feat: add ability to like books

This commit is contained in:
2026-02-04 21:14:13 -08:00
parent a9764a4a82
commit 729f410443
19 changed files with 1256 additions and 8 deletions
+14
View File
@@ -178,6 +178,7 @@ model User {
updatedAt DateTime @updatedAt
comments Comment[]
suggestions Suggestion[]
likes Like[]
}
model Comment {
@@ -226,6 +227,8 @@ enum AuditAction {
ENTRY_CREATE
ENTRY_UPDATE
ENTRY_DELETE
LIKE
UNLIKE
USER_BAN
USER_UNBAN
RATE_LIMIT_EXCEEDED
@@ -275,3 +278,14 @@ enum SuggestionStatus {
ACCEPTED
DECLINED
}
model Like {
id String @id @default(auto()) @map("_id") @db.ObjectId
userId String @db.ObjectId
user User @relation(fields: [userId], references: [id])
entityType String // 'book', 'game', 'show', 'manga', 'music', 'art'
entityId String @db.ObjectId
createdAt DateTime @default(now())
@@unique([userId, entityType, entityId])
}