feat: bunch of work done here, got comments and edit and delete

This commit is contained in:
2026-02-04 13:00:16 -08:00
parent b6d66d34cb
commit 318f3bc500
19 changed files with 1868 additions and 117 deletions
+19
View File
@@ -25,6 +25,7 @@ model Game {
coverImage String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
comments Comment[]
}
enum GameStatus {
@@ -46,6 +47,7 @@ model Book {
coverImage String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
comments Comment[]
}
enum BookStatus {
@@ -67,6 +69,7 @@ model Music {
coverArt String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
comments Comment[]
}
enum MusicType {
@@ -90,4 +93,20 @@ model User {
isAdmin Boolean @default(false)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
comments Comment[]
}
model Comment {
id String @id @default(auto()) @map("_id") @db.ObjectId
content String
userId String @db.ObjectId
user User @relation(fields: [userId], references: [id])
gameId String? @db.ObjectId
game Game? @relation(fields: [gameId], references: [id])
bookId String? @db.ObjectId
book Book? @relation(fields: [bookId], references: [id])
musicId String? @db.ObjectId
music Music? @relation(fields: [musicId], references: [id])
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}