mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-05-09 12:13:10 -05:00
65 lines
1.4 KiB
Plaintext
65 lines
1.4 KiB
Plaintext
datasource db {
|
|
provider = "postgresql"
|
|
// FIXME: should use same .env system as Next.JS
|
|
url = env("DATABASE_URL")
|
|
}
|
|
|
|
generator client {
|
|
provider = "prisma-client-js"
|
|
}
|
|
|
|
model User {
|
|
id Int @id @default(autoincrement())
|
|
username String
|
|
discriminator String
|
|
discordId String @unique
|
|
discordAvatar String?
|
|
profile Profile?
|
|
player Player?
|
|
}
|
|
|
|
model Profile {
|
|
twitterName String?
|
|
twitchName String?
|
|
youtubeId String?
|
|
country String?
|
|
sensMotion Float?
|
|
sensStick Float?
|
|
bio String?
|
|
weaponPool String[]
|
|
customUrlPath String? @unique
|
|
user User @relation(fields: [userId], references: [id])
|
|
userId Int @unique
|
|
|
|
}
|
|
|
|
enum RankedMode {
|
|
SZ
|
|
TC
|
|
RM
|
|
CB
|
|
}
|
|
|
|
model XRankPlacement {
|
|
id Int @id @default(autoincrement())
|
|
switchAccountId String
|
|
player Player @relation(fields: [switchAccountId], references: [switchAccountId])
|
|
playerName String
|
|
ranking Int
|
|
xPower Float
|
|
weapon String
|
|
mode RankedMode
|
|
month Int
|
|
year Int
|
|
|
|
@@unique([switchAccountId, mode, month, year])
|
|
}
|
|
|
|
model Player {
|
|
switchAccountId String @unique
|
|
user User? @relation(fields: [userId], references: [id])
|
|
userId Int? @unique
|
|
name String
|
|
placements XRankPlacement[]
|
|
}
|