From 910e0e67acbc3087fafa79978c8201379620d6b0 Mon Sep 17 00:00:00 2001
From: s85809 <s85809@bht-berlin.de>
Date: Tue, 30 May 2023 16:09:23 +0200
Subject: [PATCH] PrismaFix

---
 prisma/schema.prisma | 63 ++++++++++++++++++++++----------------------
 1 file changed, 32 insertions(+), 31 deletions(-)

diff --git a/prisma/schema.prisma b/prisma/schema.prisma
index c3d6ef5..7fb0d37 100644
--- a/prisma/schema.prisma
+++ b/prisma/schema.prisma
@@ -11,47 +11,48 @@ datasource db {
 }
 
 model User {
-  id            String    @id @default(cuid())
-  userName      String    @unique
-  name          String?
-  email         String?   @unique
-  emailVerified DateTime?
-  image         String?
-  Post          Post[]
-  Comment       Comment[]
-  Like          Like[]
+  id              String      @id @default(dbgenerated()) @db.Uuid
+  userName        String      @unique
+  name            String?
+  email           String?     @unique
+  emailVerified   DateTime?
+  image           String?
+
+  Post            Post[]
+  Comment         Comment[]
+  Like            Like[]
 }
 
 model Post {
-  id        String   @id @default(dbgenerated()) @db.Uuid
-  createdAt DateTime @default(now())
-  updatedAt DateTime @updatedAt
-
-  content   String
-  likeCount Int?    @default(0)
-  gameId    String?
-
-  published Boolean   @default(false)
-  userId    String
-  user      User      @relation(fields: [userId], references: [id])
-  Comment   Comment[]
-  Like      Like[]
+  id              String    @id @default(dbgenerated()) @db.Uuid
+  createdAt       DateTime  @default(now())
+  updatedAt       DateTime  @updatedAt
+  content         String
+  likeCount       Int?      @default(0)
+  gameId          String?
+  published       Boolean   @default(false)
+  userId          String    @db.Uuid
+
+  user            User      @relation(fields: [userId], references: [id], onDelete: Cascade)
+  Comment         Comment[]
+  Like            Like[]
 }
 
 model Like {
-  id     String @id @default(dbgenerated()) @db.Uuid
-  postId String
-  userId String
-  post   Post   @relation(fields: [postId], references: [id], onDelete: Cascade)
-  user   User   @relation(fields: [userId], references: [id], onDelete: Cascade)
+  id        String @id @default(dbgenerated()) @db.Uuid
+  postId    String @db.Uuid
+  userId    String @db.Uuid
+
+  post      Post   @relation(fields: [postId], references: [id], onDelete: Cascade)
+  user      User   @relation(fields: [userId], references: [id], onDelete: Cascade)
 }
 
 model Comment {
-  id        String   @id @default(cuid())
+  id        String   @id @default(dbgenerated()) @db.Uuid
   message   String
-  postId    String
-  userId    String
+  postId    String   @db.Uuid
+  userId    String   @db.Uuid
   createdAt DateTime @default(now())
   post      Post     @relation(fields: [postId], references: [id], onDelete: Cascade)
-  user      User     @relation(fields: [userId], references: [id])
+  user      User     @relation(fields: [userId], references: [id], onDelete: Cascade)
 }
-- 
GitLab