aboutsummaryrefslogtreecommitdiffstats
path: root/backend/schema.prisma
diff options
context:
space:
mode:
authorPinapelz <yukais@pinapelz.com>2025-06-29 17:50:28 -0700
committerPinapelz <yukais@pinapelz.com>2025-06-29 17:50:28 -0700
commit5e7e537b955bafd4a8bd855347a1f6466ce8d027 (patch)
tree3c75bbee23a8a585d57f6278f71b9eb057e01754 /backend/schema.prisma
parentd55b767039605256c736166a942a9138e3eacfd7 (diff)
add game and score schema to orm
Diffstat (limited to 'backend/schema.prisma')
-rw-r--r--backend/schema.prisma15
1 files changed, 15 insertions, 0 deletions
diff --git a/backend/schema.prisma b/backend/schema.prisma
index e5c4039..d3c0588 100644
--- a/backend/schema.prisma
+++ b/backend/schema.prisma
@@ -23,3 +23,18 @@ model Session {
createdAt DateTime @default(now())
expiresAt DateTime
}
+
+model Game {
+ id Int @id @default(autoincrement())
+ name String @unique
+ scores Score[]
+}
+
+model Score {
+ id Int @id @default(autoincrement())
+ gameId Int
+ userId Int
+ data Json // arbitrary data in json format
+ game Game @relation(fields: [gameId], references: [id])
+ user User @relation(fields: [userId], references: [id])
+}
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage