2022-07-11 09:22:41 +02:00
|
|
|
|
// This is your Prisma schema file,
|
|
|
|
|
// learn more about it in the docs: https://pris.ly/d/prisma-schema
|
|
|
|
|
|
|
|
|
|
generator client {
|
2022-08-15 05:47:34 +02:00
|
|
|
|
provider = "prisma-client-js"
|
2022-07-11 09:22:41 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
datasource db {
|
2022-08-15 05:47:34 +02:00
|
|
|
|
provider = "postgresql"
|
|
|
|
|
url = env("POSTGRES_URL")
|
2022-07-15 16:39:59 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
model User {
|
2022-08-15 05:47:34 +02:00
|
|
|
|
id Int @id @default(autoincrement())
|
|
|
|
|
chipId String @unique
|
|
|
|
|
accessCode String
|
|
|
|
|
cars Car[]
|
|
|
|
|
carOrder Int[]
|
|
|
|
|
items UserItem[]
|
|
|
|
|
tutorials Boolean[]
|
|
|
|
|
userBanned Boolean @default(false)
|
|
|
|
|
bookmarks Int[]
|
|
|
|
|
ScratchSheet ScratchSheet[]
|
|
|
|
|
currentSheet Int @default(1)
|
|
|
|
|
lastScratched Int @default(0) // Timestamp
|
2022-07-20 09:29:28 +02:00
|
|
|
|
}
|
|
|
|
|
|
2022-07-22 12:02:51 +02:00
|
|
|
|
model ScratchSheet {
|
2022-08-15 05:47:34 +02:00
|
|
|
|
id Int @id @default(autoincrement())
|
|
|
|
|
User User @relation(fields: [userId], references: [id])
|
|
|
|
|
userId Int
|
|
|
|
|
sheetNo Int // Player's sheet number (i.e. first sheet)
|
|
|
|
|
squares ScratchSquare[]
|
2022-07-22 12:02:51 +02:00
|
|
|
|
}
|
2022-07-20 09:29:28 +02:00
|
|
|
|
|
2022-07-22 12:02:51 +02:00
|
|
|
|
model ScratchSquare {
|
2022-08-15 05:47:34 +02:00
|
|
|
|
id Int @id @default(autoincrement())
|
|
|
|
|
Sheet ScratchSheet @relation(fields: [sheetId], references: [id])
|
|
|
|
|
sheetId Int
|
|
|
|
|
category Int
|
|
|
|
|
itemId Int
|
|
|
|
|
earned Boolean
|
2022-07-22 12:02:51 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
model UserItem {
|
2022-08-15 05:47:34 +02:00
|
|
|
|
userItemId Int @id @default(autoincrement())
|
|
|
|
|
category Int
|
|
|
|
|
itemId Int
|
|
|
|
|
User User @relation(fields: [userId], references: [id])
|
|
|
|
|
userId Int
|
|
|
|
|
type Int @default(0)
|
|
|
|
|
earnedAt Int @default(0)
|
2022-07-15 16:39:59 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
model Car {
|
2022-08-15 05:47:34 +02:00
|
|
|
|
user User @relation(fields: [userId], references: [id])
|
|
|
|
|
userId Int
|
|
|
|
|
|
|
|
|
|
// This is the Car object itself
|
|
|
|
|
carId Int @id @default(autoincrement())
|
|
|
|
|
name String
|
|
|
|
|
manufacturer Int
|
|
|
|
|
regionId Int @default(0)
|
2022-08-15 10:05:43 +02:00
|
|
|
|
country String @default("JPN")
|
2022-08-15 05:47:34 +02:00
|
|
|
|
model Int
|
|
|
|
|
visualModel Int
|
|
|
|
|
customColor Int @default(0)
|
|
|
|
|
defaultColor Int
|
|
|
|
|
wheel Int @default(0)
|
|
|
|
|
wheelColor Int @default(0)
|
|
|
|
|
aero Int @default(0)
|
|
|
|
|
bonnet Int @default(0)
|
|
|
|
|
wing Int @default(0)
|
|
|
|
|
mirror Int @default(0)
|
|
|
|
|
neon Int @default(0)
|
|
|
|
|
trunk Int @default(0)
|
|
|
|
|
plate Int @default(0)
|
|
|
|
|
plateColor Int @default(0)
|
|
|
|
|
plateNumber Int @default(0)
|
|
|
|
|
tunePower Int @default(0)
|
|
|
|
|
tuneHandling Int @default(0)
|
|
|
|
|
title String @default("New Car")
|
|
|
|
|
level Int @default(0)
|
|
|
|
|
windowSticker Boolean @default(false)
|
|
|
|
|
windowStickerString String @default("WANGAN")
|
|
|
|
|
windowStickerFont Int @default(0)
|
|
|
|
|
windowDecoration Int @default(0)
|
|
|
|
|
rivalMarker Int @default(0)
|
|
|
|
|
lastPlayedAt Int @default(0)
|
|
|
|
|
aura Int @default(0)
|
|
|
|
|
|
|
|
|
|
// This is more data about the car
|
|
|
|
|
tuningPoints Int @default(0)
|
|
|
|
|
odometer Int @default(0)
|
|
|
|
|
playCount Int @default(0)
|
|
|
|
|
earnedCustomColor Boolean @default(false)
|
|
|
|
|
carSettingsDbId Int @unique
|
|
|
|
|
settings CarSettings @relation(fields: [carSettingsDbId], references: [dbId])
|
2022-08-24 11:46:52 +02:00
|
|
|
|
|
|
|
|
|
auraMotif Int @default(0)
|
2022-08-15 05:47:34 +02:00
|
|
|
|
vsPlayCount Int @default(0)
|
|
|
|
|
vsBurstCount Int @default(0)
|
|
|
|
|
vsStarCount Int @default(0)
|
2022-08-24 11:46:52 +02:00
|
|
|
|
vsStarCountMax Int @default(0)
|
2022-08-15 05:47:34 +02:00
|
|
|
|
vsCoolOrWild Int @default(0)
|
|
|
|
|
vsSmoothOrRough Int @default(0)
|
|
|
|
|
vsTripleStarMedals Int @default(0)
|
|
|
|
|
vsDoubleStarMedals Int @default(0)
|
|
|
|
|
vsSingleStarMedals Int @default(0)
|
|
|
|
|
vsPlainMedals Int @default(0)
|
2022-08-24 11:46:52 +02:00
|
|
|
|
|
|
|
|
|
ghostLevel Int @default(1)
|
2022-08-15 05:47:34 +02:00
|
|
|
|
rgPlayCount Int @default(0)
|
|
|
|
|
rgWinCount Int @default(0)
|
|
|
|
|
rgTrophy Int @default(0)
|
|
|
|
|
rgScore Int @default(0)
|
|
|
|
|
rgStamp Int @default(0)
|
|
|
|
|
rgAcquireAllCrowns Boolean @default(false)
|
|
|
|
|
rgRegionMapScore Int[]
|
2022-08-24 11:46:52 +02:00
|
|
|
|
stampSheetCount Int @default(0)
|
|
|
|
|
stampSheet Int[]
|
|
|
|
|
|
2022-08-15 05:47:34 +02:00
|
|
|
|
dressupLevel Int @default(0)
|
|
|
|
|
dressupPoint Int @default(0)
|
2022-08-24 11:46:52 +02:00
|
|
|
|
|
2022-08-15 05:47:34 +02:00
|
|
|
|
stPlayCount Int @default(0)
|
|
|
|
|
stClearBits Int @default(0)
|
|
|
|
|
stClearDivCount Int @default(0)
|
|
|
|
|
stClearCount Int @default(0)
|
|
|
|
|
stLoseBits BigInt @default(0)
|
|
|
|
|
stConsecutiveWins Int @default(0)
|
|
|
|
|
stConsecutiveWinsMax Int @default(0)
|
|
|
|
|
stCompleted100Episodes Boolean @default(false)
|
|
|
|
|
|
2022-08-24 11:46:52 +02:00
|
|
|
|
lastPlayedPlaceId Int?
|
|
|
|
|
lastPlayedPlace PlaceList? @relation(fields: [lastPlayedPlaceId], references: [id])
|
|
|
|
|
|
|
|
|
|
items CarItem[]
|
|
|
|
|
carGTWingDbId Int @unique
|
|
|
|
|
gtWing CarGTWing @relation(fields: [carGTWingDbId], references: [dbId])
|
|
|
|
|
carStateDbId Int @unique
|
|
|
|
|
state CarState @relation(fields: [carStateDbId], references: [dbId])
|
|
|
|
|
TimeAttackRecord TimeAttackRecord[]
|
|
|
|
|
CarCrown CarCrown[]
|
|
|
|
|
GhostTrail GhostTrail[]
|
|
|
|
|
GhostBattleRecord GhostBattleRecord[]
|
|
|
|
|
CarPathandTuning CarPathandTuning[]
|
2022-08-18 10:15:42 +02:00
|
|
|
|
OCMGhostBattleRecord OCMGhostBattleRecord[]
|
|
|
|
|
OCMTally OCMTally[]
|
|
|
|
|
OCMTop1Ghost OCMTop1Ghost[]
|
|
|
|
|
OCMGhostTrail OCMGhostTrail[]
|
|
|
|
|
OCMPlayRecord OCMPlayRecord[]
|
|
|
|
|
GhostRegisteredFromTerminal GhostRegisteredFromTerminal[]
|
2022-08-24 11:46:52 +02:00
|
|
|
|
CarStampTarget CarStampTarget[]
|
|
|
|
|
CarChallenger CarChallenger[]
|
2022-07-15 16:39:59 +02:00
|
|
|
|
}
|
|
|
|
|
|
2022-07-25 10:23:12 +02:00
|
|
|
|
model CarGTWing {
|
2022-08-15 05:47:34 +02:00
|
|
|
|
dbId Int @id @default(autoincrement())
|
|
|
|
|
car Car?
|
|
|
|
|
|
|
|
|
|
pillar Int @default(0)
|
|
|
|
|
pillarMaterial Int @default(0)
|
|
|
|
|
mainWing Int @default(0)
|
|
|
|
|
mainWingColor Int @default(0)
|
|
|
|
|
wingTip Int @default(0)
|
|
|
|
|
material Int @default(0)
|
2022-07-25 10:23:12 +02:00
|
|
|
|
}
|
|
|
|
|
|
2022-07-15 16:39:59 +02:00
|
|
|
|
model CarItem {
|
2022-08-15 05:47:34 +02:00
|
|
|
|
dbId Int @id @default(autoincrement())
|
|
|
|
|
Car Car @relation(fields: [carId], references: [carId])
|
|
|
|
|
carId Int
|
|
|
|
|
category Int
|
|
|
|
|
itemId Int
|
|
|
|
|
amount Int
|
2022-07-15 16:39:59 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
model CarSettings {
|
2022-08-15 05:47:34 +02:00
|
|
|
|
dbId Int @id @default(autoincrement())
|
|
|
|
|
car Car?
|
|
|
|
|
|
|
|
|
|
view Boolean @default(true)
|
|
|
|
|
transmission Boolean @default(false)
|
|
|
|
|
retire Boolean @default(false)
|
|
|
|
|
meter Int @default(0)
|
|
|
|
|
navigationMap Boolean @default(true)
|
2022-08-24 11:46:52 +02:00
|
|
|
|
volume Int @default(2)
|
2022-08-15 05:47:34 +02:00
|
|
|
|
bgm Int @default(0)
|
|
|
|
|
nameplate Int @default(0)
|
|
|
|
|
nameplateColor Int @default(0)
|
|
|
|
|
terminalBackground Int @default(0)
|
2022-07-15 16:39:59 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
model CarState {
|
2022-08-15 05:47:34 +02:00
|
|
|
|
dbId Int @id @default(autoincrement())
|
|
|
|
|
car Car?
|
2022-07-15 16:39:59 +02:00
|
|
|
|
|
2022-08-15 05:47:34 +02:00
|
|
|
|
hasOpponentGhost Boolean @default(false)
|
|
|
|
|
eventJoined Boolean @default(false)
|
|
|
|
|
transferred Boolean @default(false)
|
|
|
|
|
toBeDeleted Boolean @default(false)
|
|
|
|
|
competitionState Int @default(0)
|
2022-07-11 09:22:41 +02:00
|
|
|
|
}
|
2022-07-16 23:46:40 +02:00
|
|
|
|
|
2022-08-15 05:47:34 +02:00
|
|
|
|
model CarPathandTuning {
|
|
|
|
|
dbId Int @id @default(autoincrement())
|
|
|
|
|
car Car @relation(fields: [carId], references: [carId])
|
|
|
|
|
carId Int
|
|
|
|
|
area Int @default(0)
|
|
|
|
|
ramp Int @default(0)
|
|
|
|
|
path Int @default(0)
|
|
|
|
|
tunePower Int @default(17)
|
|
|
|
|
tuneHandling Int @default(17)
|
|
|
|
|
lastPlayedAt Int @default(0)
|
2022-07-16 23:46:40 +02:00
|
|
|
|
}
|
2022-07-29 11:13:21 +02:00
|
|
|
|
|
|
|
|
|
model CarCrown {
|
2022-08-15 05:47:34 +02:00
|
|
|
|
dbId Int @id @default(autoincrement())
|
|
|
|
|
car Car @relation(fields: [carId], references: [carId])
|
|
|
|
|
carId Int
|
|
|
|
|
area Int @unique
|
|
|
|
|
ramp Int
|
|
|
|
|
path Int
|
|
|
|
|
playedAt Int @default(0)
|
|
|
|
|
tunePower Int
|
|
|
|
|
tuneHandling Int
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
model TimeAttackRecord {
|
|
|
|
|
dbId Int @id @default(autoincrement())
|
|
|
|
|
|
|
|
|
|
car Car @relation(fields: [carId], references: [carId])
|
|
|
|
|
carId Int
|
|
|
|
|
|
|
|
|
|
model Int // Car model, literally just the `model` field from Car
|
|
|
|
|
time Int
|
|
|
|
|
course Int
|
|
|
|
|
isMorning Boolean
|
|
|
|
|
section1Time Int @map("section1Time")
|
|
|
|
|
section2Time Int @map("section2Time")
|
|
|
|
|
section3Time Int @map("section3Time")
|
|
|
|
|
section4Time Int @map("section4Time")
|
|
|
|
|
section5Time Int? @map("section5Time")
|
|
|
|
|
section6Time Int? @map("section6Time")
|
|
|
|
|
section7Time Int? @map("section7Time")
|
|
|
|
|
tunePower Int @default(0) // Car Power
|
|
|
|
|
tuneHandling Int @default(0) // Car Handling
|
2022-07-29 11:13:21 +02:00
|
|
|
|
}
|
2022-07-29 14:37:45 +02:00
|
|
|
|
|
|
|
|
|
model GhostTrail {
|
2022-08-15 05:47:34 +02:00
|
|
|
|
dbId Int @id @default(autoincrement())
|
|
|
|
|
car Car @relation(fields: [carId], references: [carId])
|
|
|
|
|
carId Int
|
|
|
|
|
area Int
|
|
|
|
|
ramp Int
|
|
|
|
|
path Int
|
|
|
|
|
trail Bytes
|
|
|
|
|
time Int?
|
|
|
|
|
driveData Bytes? @db.ByteA
|
|
|
|
|
driveDMergeSerial Int?
|
|
|
|
|
trendBinaryByUser Bytes? @db.ByteA
|
|
|
|
|
byUserMergeSerial Int?
|
|
|
|
|
trendBinaryByArea Bytes? @db.ByteA
|
|
|
|
|
byAreaMergeSerial Int?
|
|
|
|
|
trendBinaryByCar Bytes? @db.ByteA
|
|
|
|
|
byCarMergeSerial Int?
|
|
|
|
|
playedAt Int @default(0)
|
|
|
|
|
tunePower Int @default(0)
|
|
|
|
|
tuneHandling Int @default(0)
|
|
|
|
|
crownBattle Boolean @default(false)
|
2022-07-29 14:37:45 +02:00
|
|
|
|
}
|
2022-08-04 14:14:26 +02:00
|
|
|
|
|
|
|
|
|
model GhostBattleRecord {
|
2022-08-15 05:47:34 +02:00
|
|
|
|
dbId Int @id @default(autoincrement())
|
|
|
|
|
car Car @relation(fields: [carId], references: [carId])
|
|
|
|
|
carId Int
|
|
|
|
|
tunePower Int @default(0)
|
|
|
|
|
tuneHandling Int @default(0)
|
|
|
|
|
opponent1CarId Int
|
|
|
|
|
opponent1Result Int
|
|
|
|
|
opponent1TunePower Int
|
|
|
|
|
opponent1TuneHandling Int
|
|
|
|
|
opponent2CarId Int?
|
|
|
|
|
opponent2Result Int?
|
|
|
|
|
opponent2TunePower Int?
|
|
|
|
|
opponent2TuneHandling Int?
|
|
|
|
|
opponent3CarId Int?
|
|
|
|
|
opponent3Result Int?
|
|
|
|
|
opponent3TunePower Int?
|
|
|
|
|
opponent3TuneHandling Int?
|
|
|
|
|
area Int @default(0)
|
|
|
|
|
playedAt Int @default(0)
|
|
|
|
|
playedShopName String @default("Bayshore")
|
2022-08-04 14:14:26 +02:00
|
|
|
|
}
|
2022-08-05 05:46:29 +02:00
|
|
|
|
|
2022-08-15 05:47:34 +02:00
|
|
|
|
model OCMEvent {
|
|
|
|
|
dbId Int @id @default(autoincrement())
|
|
|
|
|
competitionId Int
|
|
|
|
|
qualifyingPeriodStartAt Int
|
|
|
|
|
qualifyingPeriodCloseAt Int
|
|
|
|
|
competitionStartAt Int
|
|
|
|
|
competitionCloseAt Int
|
|
|
|
|
competitionEndAt Int
|
|
|
|
|
lengthOfPeriod Int
|
|
|
|
|
lengthOfInterval Int
|
|
|
|
|
area Int @default(0)
|
|
|
|
|
minigamePatternId Int @default(0)
|
|
|
|
|
|
|
|
|
|
OCMPeriod OCMPeriod[]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
model OCMPlayRecord {
|
|
|
|
|
dbId Int @id @default(autoincrement())
|
|
|
|
|
car Car @relation(fields: [carId], references: [carId])
|
|
|
|
|
carId Int
|
|
|
|
|
competitionId Int
|
|
|
|
|
periodId Int
|
|
|
|
|
brakingPoint Int?
|
|
|
|
|
playedAt Int @default(0)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
model OCMTop1Ghost {
|
|
|
|
|
dbId Int @id @default(autoincrement())
|
|
|
|
|
car Car @relation(fields: [carId], references: [carId])
|
|
|
|
|
carId Int
|
|
|
|
|
competitionId Int
|
|
|
|
|
periodId Int
|
|
|
|
|
result Int
|
|
|
|
|
tunePower Int @default(0)
|
|
|
|
|
tuneHandling Int @default(0)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
model OCMTop1GhostTrail {
|
|
|
|
|
dbId Int @id @default(autoincrement())
|
|
|
|
|
carId Int
|
|
|
|
|
area Int
|
|
|
|
|
ramp Int
|
|
|
|
|
path Int
|
|
|
|
|
trail Bytes
|
|
|
|
|
competitionId Int
|
|
|
|
|
periodId Int
|
|
|
|
|
playedAt Int @default(0)
|
|
|
|
|
tunePower Int @default(0)
|
|
|
|
|
tuneHandling Int @default(0)
|
|
|
|
|
ocmMainDraw Boolean @default(false)
|
2022-08-05 05:46:29 +02:00
|
|
|
|
}
|
2022-08-15 05:47:34 +02:00
|
|
|
|
|
|
|
|
|
model OCMTally {
|
|
|
|
|
dbId Int @id @default(autoincrement())
|
|
|
|
|
car Car @relation(fields: [carId], references: [carId])
|
|
|
|
|
carId Int
|
|
|
|
|
competitionId Int
|
|
|
|
|
periodId Int
|
|
|
|
|
result Int
|
|
|
|
|
tunePower Int @default(0)
|
|
|
|
|
tuneHandling Int @default(0)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
model OCMGhostBattleRecord {
|
|
|
|
|
dbId Int @id @default(autoincrement())
|
|
|
|
|
car Car @relation(fields: [carId], references: [carId])
|
|
|
|
|
carId Int
|
|
|
|
|
tunePower Int @default(0)
|
|
|
|
|
tuneHandling Int @default(0)
|
|
|
|
|
competitionId Int
|
|
|
|
|
periodId Int
|
|
|
|
|
result Int
|
|
|
|
|
area Int @default(0)
|
|
|
|
|
playedAt Int @default(0)
|
|
|
|
|
playedShopName String @default("Bayshore")
|
|
|
|
|
ocmMainDraw Boolean @default(false)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
model OCMGhostTrail {
|
|
|
|
|
dbId Int @id @default(autoincrement())
|
|
|
|
|
car Car @relation(fields: [carId], references: [carId])
|
|
|
|
|
carId Int
|
|
|
|
|
area Int
|
|
|
|
|
ramp Int
|
|
|
|
|
path Int
|
|
|
|
|
trail Bytes
|
|
|
|
|
competitionId Int
|
|
|
|
|
periodId Int
|
|
|
|
|
playedAt Int @default(0)
|
|
|
|
|
tunePower Int @default(0)
|
|
|
|
|
tuneHandling Int @default(0)
|
|
|
|
|
ocmMainDraw Boolean @default(false)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
model OCMPeriod {
|
|
|
|
|
dbId Int @id @default(autoincrement())
|
|
|
|
|
OCMEvent OCMEvent @relation(fields: [competitionDbId], references: [dbId])
|
|
|
|
|
competitionDbId Int
|
|
|
|
|
competitionId Int
|
|
|
|
|
periodId Int
|
|
|
|
|
startAt Int
|
|
|
|
|
closeAt Int
|
2022-08-18 10:15:42 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
model GhostRegisteredFromTerminal {
|
|
|
|
|
dbId Int @id @default(autoincrement())
|
|
|
|
|
car Car @relation(fields: [carId], references: [carId])
|
|
|
|
|
carId Int
|
|
|
|
|
competitionId Int?
|
|
|
|
|
opponentCarId Int
|
2022-08-24 11:46:52 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
model CarChallenger {
|
|
|
|
|
id Int @id @default(autoincrement())
|
|
|
|
|
challengerCar Car @relation(fields: [challengerCarId], references: [carId])
|
|
|
|
|
|
|
|
|
|
carId Int
|
|
|
|
|
challengerCarId Int
|
|
|
|
|
stamp Int
|
|
|
|
|
result Int
|
|
|
|
|
area Int
|
2022-08-25 06:16:44 +02:00
|
|
|
|
lastPlayedAt Int @default(0)
|
2022-08-24 11:46:52 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
model CarStampTarget {
|
|
|
|
|
id Int @id @default(autoincrement())
|
|
|
|
|
stampTargetCar Car @relation(fields: [stampTargetCarId], references: [carId])
|
|
|
|
|
carId Int
|
|
|
|
|
stampTargetCarId Int
|
|
|
|
|
returnCount Int
|
|
|
|
|
locked Boolean
|
|
|
|
|
recommended Boolean
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
model PlaceList {
|
|
|
|
|
id Int @id @default(autoincrement())
|
|
|
|
|
car Car[]
|
|
|
|
|
|
|
|
|
|
placeId String
|
|
|
|
|
regionId Int
|
|
|
|
|
shopName String
|
|
|
|
|
country String
|
2022-08-15 05:47:34 +02:00
|
|
|
|
}
|