diff options
| author | Pinapelz <yukais@pinapelz.com> | 2025-06-29 17:50:28 -0700 |
|---|---|---|
| committer | Pinapelz <yukais@pinapelz.com> | 2025-06-29 17:50:28 -0700 |
| commit | 5e7e537b955bafd4a8bd855347a1f6466ce8d027 (patch) | |
| tree | 3c75bbee23a8a585d57f6278f71b9eb057e01754 /backend/schema.prisma | |
| parent | d55b767039605256c736166a942a9138e3eacfd7 (diff) | |
add game and score schema to orm
Diffstat (limited to 'backend/schema.prisma')
| -rw-r--r-- | backend/schema.prisma | 15 |
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]) +} |
