mirror of
https://github.com/Drop-OSS/drop.git
synced 2025-11-13 00:02:37 +10:00
New ObjectBackend class that requires implementors to specify a few basic functions, and it handles the permission logic on top of that. Hopefully there is enough abstraction to suite further use cases!
126 lines
2.6 KiB
Plaintext
126 lines
2.6 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)
|
|
|
|
email String
|
|
displayName String
|
|
|
|
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 {
|
|
id String @id @default(uuid())
|
|
userId String
|
|
user User @relation(fields: [userId], references: [id])
|
|
|
|
endpoint String
|
|
capabilities ClientCapabilities[]
|
|
|
|
name String
|
|
platform String
|
|
lastConnected DateTime
|
|
}
|
|
|
|
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")
|
|
}
|