aboutsummaryrefslogtreecommitdiffstats
path: root/backend/schema.prisma
diff options
context:
space:
mode:
authorPinapelz <yukais@pinapelz.com>2025-07-07 00:00:22 -0700
committerPinapelz <yukais@pinapelz.com>2025-07-07 00:00:22 -0700
commit152894146b72830e48e800721ea6160228a9bdc1 (patch)
tree081a7e0c7988988d14583894c2f2ea80d2ab0538 /backend/schema.prisma
parentdf79d68cb3cbec15e985fed8c0cabc484ef55e35 (diff)
generate sha-1 hash for chart on score import
Diffstat (limited to 'backend/schema.prisma')
-rw-r--r--backend/schema.prisma24
1 files changed, 18 insertions, 6 deletions
diff --git a/backend/schema.prisma b/backend/schema.prisma
index 467d59d..a613628 100644
--- a/backend/schema.prisma
+++ b/backend/schema.prisma
@@ -30,14 +30,26 @@ model Game {
formattedName String @unique
description String
scores Score[]
+ charts Charts[]
}
model Score {
- id Int @id @default(autoincrement())
+ id Int @id @default(autoincrement())
gameInternalName String
- userId Int
- timestamp BigInt //in UNIX milliseconds
- data Json
- game Game @relation(fields: [gameInternalName], references: [internalName])
- user User @relation(fields: [userId], references: [id])
+ chartId String
+ userId Int
+ timestamp BigInt // in UNIX milliseconds
+ data Json
+ game Game @relation(fields: [gameInternalName], references: [internalName])
+ user User @relation(fields: [userId], references: [id])
+ chart Charts @relation(fields: [chartId], references: [chartId])
+}
+
+model Charts {
+ chartId String @id // platform-wide unique hash
+ gameInternalName String
+ title String
+ artist String
+ game Game @relation(fields: [gameInternalName], references: [internalName])
+ scores Score[]
}
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage