Skip to content
Snippets Groups Projects
Commit 09d4dc0e authored by Omar Kasbah's avatar Omar Kasbah
Browse files

Prisma Fix

parent fcbb8ac8
No related branches found
No related tags found
1 merge request!13Feat.next auth
Pipeline #35281 failed
...@@ -11,7 +11,7 @@ datasource db { ...@@ -11,7 +11,7 @@ datasource db {
} }
model User { model User {
id String @id @default(dbgenerated()) @db.Uuid id Int @id @default(autoincrement())
userName String? @unique userName String? @unique
name String? name String?
email String? @unique email String? @unique
...@@ -25,14 +25,14 @@ model User { ...@@ -25,14 +25,14 @@ model User {
} }
model Post { model Post {
id String @id @default(dbgenerated()) @db.Uuid id Int @id @default(autoincrement())
createdAt DateTime @default(now()) createdAt DateTime @default(now())
updatedAt DateTime @updatedAt updatedAt DateTime @updatedAt
content String content String
likeCount Int? @default(0) likeCount Int? @default(0)
gameId String? gameId Int?
published Boolean @default(false) published Boolean @default(false)
userId String @db.Uuid userId Int
user User @relation(fields: [userId], references: [id], onDelete: Cascade) user User @relation(fields: [userId], references: [id], onDelete: Cascade)
Comment Comment[] Comment Comment[]
...@@ -40,19 +40,19 @@ model Post { ...@@ -40,19 +40,19 @@ model Post {
} }
model Like { model Like {
id String @id @default(dbgenerated()) @db.Uuid id Int @id @default(autoincrement())
postId String @db.Uuid postId Int
userId String @db.Uuid userId Int
post Post @relation(fields: [postId], references: [id], onDelete: Cascade) post Post @relation(fields: [postId], references: [id], onDelete: Cascade)
user User @relation(fields: [userId], references: [id], onDelete: Cascade) user User @relation(fields: [userId], references: [id], onDelete: Cascade)
} }
model Comment { model Comment {
id String @id @default(dbgenerated()) @db.Uuid id Int @id @default(autoincrement())
message String message String
postId String @db.Uuid postId Int
userId String @db.Uuid userId Int
createdAt DateTime @default(now()) createdAt DateTime @default(now())
post Post @relation(fields: [postId], references: [id], onDelete: Cascade) post Post @relation(fields: [postId], references: [id], onDelete: Cascade)
user User @relation(fields: [userId], references: [id], onDelete: Cascade) user User @relation(fields: [userId], references: [id], onDelete: Cascade)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment