feat: unified company metadata store

still need to migrate users from old developer and publisher tables
This commit is contained in:
Huskydog9988
2025-05-08 20:35:15 -04:00
committed by DecDuck
parent 14f0833d17
commit afaaaf2eb5
9 changed files with 159 additions and 65 deletions

View File

@ -33,9 +33,10 @@ model Game {
versions GameVersion[]
libraryBasePath String @unique // Base dir for all the game versions
collections CollectionEntry[]
saves SaveSlot[]
screenshots Screenshot[]
collections CollectionEntry[]
saves SaveSlot[]
screenshots Screenshot[]
companyRelations CompanyGameRelation[]
@@unique([metadataSource, metadataId], name: "metadataKey")
}
@ -102,6 +103,38 @@ model Screenshot {
@@index([gameId, userId])
}
model Company {
id String @id @default(uuid())
metadataSource MetadataSource
metadataId String
metadataOriginalQuery String
mName String
mShortDescription String
mDescription String
mLogoObjectId String
mBannerObjectId String
mWebsite String
gameRelations CompanyGameRelation[]
@@unique([metadataSource, metadataId], name: "metadataKey")
}
model CompanyGameRelation {
companyId String
company Company @relation(fields: [companyId], references: [id], onDelete: Cascade)
gameId String
game Game @relation(fields: [gameId], references: [id], onDelete: Cascade)
// what the company did for the game
developer Boolean @default(false)
publisher Boolean @default(false)
@@unique([companyId, gameId], name: "companyGame")
}
model Developer {
id String @id @default(uuid())