mirror of
https://github.com/Drop-OSS/drop.git
synced 2025-11-10 04:22:09 +10:00
122 lines
2.5 KiB
Plaintext
122 lines
2.5 KiB
Plaintext
// This is your Prisma schema file,
|
|
// learn more about it in the docs: https://pris.ly/d/prisma-schema
|
|
|
|
// Looking for ways to speed up your queries, or scale easily with your serverless or edge functions?
|
|
// Try Prisma Accelerate: https://pris.ly/cli/accelerate-init
|
|
|
|
generator client {
|
|
provider = "prisma-client-js"
|
|
}
|
|
|
|
datasource db {
|
|
provider = "postgresql"
|
|
url = env("DATABASE_URL")
|
|
}
|
|
|
|
model User {
|
|
id String @id @default(uuid())
|
|
username String @unique
|
|
admin Boolean @default(false)
|
|
|
|
authMecs LinkedAuthMec[]
|
|
clients Client[]
|
|
}
|
|
|
|
enum AuthMec {
|
|
Simple
|
|
}
|
|
|
|
model LinkedAuthMec {
|
|
userId String
|
|
mec AuthMec
|
|
|
|
credentials Json
|
|
|
|
user User @relation(fields: [userId], references: [id])
|
|
|
|
@@id([userId, mec])
|
|
}
|
|
|
|
enum ClientCapabilities {
|
|
DownloadAggregation
|
|
}
|
|
|
|
// References a device
|
|
model Client {
|
|
sharedToken String @id @default(uuid())
|
|
userId String
|
|
user User @relation(fields: [userId], references: [id])
|
|
|
|
endpoint String
|
|
capabilities ClientCapabilities[]
|
|
|
|
name String
|
|
platform String
|
|
}
|
|
|
|
enum MetadataSource {
|
|
Custom
|
|
GiantBomb
|
|
}
|
|
|
|
model Game {
|
|
id String @id @default(uuid())
|
|
|
|
metadataSource MetadataSource
|
|
metadataId String
|
|
|
|
// Any field prefixed with m is filled in from metadata
|
|
// Acts as a cache so we can search and filter it
|
|
mName String // Name of game
|
|
mShortDescription String // Short description
|
|
mDescription String // Supports markdown
|
|
mDevelopers Developer[]
|
|
mPublishers Publisher[]
|
|
|
|
mReviewCount Int
|
|
mReviewRating Float
|
|
|
|
mIconId String // linked to objects in s3
|
|
mBannerId String // linked to objects in s3
|
|
mArt String[] // linked to objects in s3
|
|
mScreenshots String[] // linked to objects in s3
|
|
|
|
@@unique([metadataSource, metadataId], name: "metadataKey")
|
|
}
|
|
|
|
model Developer {
|
|
id String @id @default(uuid())
|
|
|
|
metadataSource MetadataSource
|
|
metadataId String
|
|
|
|
mName String
|
|
mShortDescription String
|
|
mDescription String
|
|
mLogo String
|
|
mBanner String
|
|
mWebsite String
|
|
|
|
games Game[]
|
|
|
|
@@unique([metadataSource, metadataId], name: "metadataKey")
|
|
}
|
|
|
|
model Publisher {
|
|
id String @id @default(uuid())
|
|
|
|
metadataSource MetadataSource
|
|
metadataId String
|
|
|
|
mName String
|
|
mShortDescription String
|
|
mDescription String
|
|
mLogo String
|
|
mBanner String
|
|
mWebsite String
|
|
|
|
games Game[]
|
|
|
|
@@unique([metadataSource, metadataId], name: "metadataKey")
|
|
}
|