Add age ratings (#451)

* Base age rating system

* Cleanup enum leftovers

* Missed files

* GB importer

* Linter settings

* Translations

* Prettier and linting

---------

Co-authored-by: Robert Clabough <robert@clabough.tech>
This commit is contained in:
AgentScrubbles
2026-07-26 11:42:16 +10:00
committed by GitHub
co-authored by Robert Clabough
parent 8e75a0bf56
commit 97c6f2c8a6
22 changed files with 704 additions and 5 deletions
+25 -1
View File
@@ -31,7 +31,8 @@ model Game {
mDescription String // Supports markdown
mReleased DateTime // When the game was released
ratings GameRating[]
ratings GameRating[]
ageRatings GameAgeRating[]
featured Boolean @default(false)
@@ -73,6 +74,29 @@ model GameTag {
@@index([name(ops: raw("gist_trgm_ops(siglen=32)"))], type: Gist)
}
enum AgeRatingOrganization {
ESRB
PEGI
CERO
USK
GRAC
ClassInd
ACB
}
model GameAgeRating {
id String @id @default(uuid())
organization AgeRatingOrganization
rating String // e.g. "E", "T", "M", "18", "CERO_B", comes from server enums
ratingCoverUrl String? // Badge image URL from IGDB, optional
game Game @relation(fields: [gameId], references: [id], onDelete: Cascade)
gameId String
@@unique([gameId, organization], name: "gameOrganizationKey")
}
model GameRating {
id String @id @default(uuid())