From 2a345ebe85c60fce9a98b0d4f827c4ed38f0adf4 Mon Sep 17 00:00:00 2001 From: justnyx Date: Sat, 7 Dec 2024 17:12:22 +0100 Subject: [PATCH] Updated prisma schema Co-authored-by: DankaMarci Co-authored-by: BalintKing --- apps/backend/prisma/schema.prisma | 37 ++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/apps/backend/prisma/schema.prisma b/apps/backend/prisma/schema.prisma index 1fcb3eb..a5a90ca 100644 --- a/apps/backend/prisma/schema.prisma +++ b/apps/backend/prisma/schema.prisma @@ -30,6 +30,22 @@ model User { bandMemberships BandMembership[] reservations Reservation[] @relation("Reservations") gateKeeping Reservation[] @relation("GateKeeping") + cardRight CardRight? + profilePicture ProfilePicture? +} + +model ProfilePicture { + id Int @id @default(autoincrement()) + user User @relation(fields: [userId], references: [id]) + userId Int @unique + mimeType String + profileImage Bytes +} + +model CardRight { + id Int @id @default(autoincrement()) + userId Int @unique + user User @relation(fields: [userId], references: [id]) } enum ReservationStatus { @@ -50,16 +66,10 @@ model Reservation { status ReservationStatus } -model Genre { - id Int @id @default(autoincrement()) - name String - bands Band[] -} - model Band { id Int @id @default(autoincrement()) name String - genres Genre[] + genres String? members BandMembership[] reservations Reservation[] email String? @@ -82,8 +92,15 @@ model BandMembership { } model Comment { + id Int @id @default(autoincrement()) + comment String + startTime DateTime + endTime DateTime + isReservable Boolean +} + +model Period { id Int @id @default(autoincrement()) - comment String - startTime DateTime - endTime DateTime + startDate DateTime + endDate DateTime }