@@ -179,9 +179,17 @@ model Game {
|
||||
// External Data
|
||||
igdbId Int? @unique
|
||||
rawgId Int? @unique
|
||||
sourceUrl String? // URL where this game was scraped from
|
||||
|
||||
// Details
|
||||
rating Float?
|
||||
developer String?
|
||||
publisher String?
|
||||
|
||||
// Relations
|
||||
platforms GamePlatform[]
|
||||
genres GameGenre[]
|
||||
screenshots GameScreenshot[]
|
||||
subscriptions Subscription[]
|
||||
|
||||
// Timestamps
|
||||
@@ -193,6 +201,35 @@ model Game {
|
||||
@@index([slug])
|
||||
}
|
||||
|
||||
model Genre {
|
||||
id String @id @default(uuid())
|
||||
name String @unique
|
||||
slug String @unique
|
||||
|
||||
games GameGenre[]
|
||||
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
model GameGenre {
|
||||
gameId String
|
||||
genreId String
|
||||
game Game @relation(fields: [gameId], references: [id], onDelete: Cascade)
|
||||
genre Genre @relation(fields: [genreId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@id([gameId, genreId])
|
||||
}
|
||||
|
||||
model GameScreenshot {
|
||||
id String @id @default(uuid())
|
||||
url String
|
||||
gameId String
|
||||
game Game @relation(fields: [gameId], references: [id], onDelete: Cascade)
|
||||
|
||||
createdAt DateTime @default(now())
|
||||
}
|
||||
|
||||
model Platform {
|
||||
id String @id @default(uuid())
|
||||
name String @unique // "PlayStation 5", "PC", "Xbox Series X"
|
||||
|
||||
Reference in New Issue
Block a user