From 5e7e537b955bafd4a8bd855347a1f6466ce8d027 Mon Sep 17 00:00:00 2001 From: Pinapelz Date: Sun, 29 Jun 2025 17:50:28 -0700 Subject: add game and score schema to orm --- backend/schema.prisma | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'backend/schema.prisma') 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]) +} -- cgit v1.2.3