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

PrismaFix

parent 08b20fdd
No related branches found
No related tags found
1 merge request!13Feat.next auth
Pipeline #35268 failed
...@@ -11,47 +11,48 @@ datasource db { ...@@ -11,47 +11,48 @@ datasource db {
} }
model User { model User {
id String @id @default(cuid()) id String @id @default(dbgenerated()) @db.Uuid
userName String @unique userName String @unique
name String? name String?
email String? @unique email String? @unique
emailVerified DateTime? emailVerified DateTime?
image String? image String?
Post Post[]
Comment Comment[] Post Post[]
Like Like[] Comment Comment[]
Like Like[]
} }
model Post { model Post {
id String @id @default(dbgenerated()) @db.Uuid id String @id @default(dbgenerated()) @db.Uuid
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 String? published Boolean @default(false)
userId String @db.Uuid
published Boolean @default(false)
userId String user User @relation(fields: [userId], references: [id], onDelete: Cascade)
user User @relation(fields: [userId], references: [id]) Comment Comment[]
Comment Comment[] Like Like[]
Like Like[]
} }
model Like { model Like {
id String @id @default(dbgenerated()) @db.Uuid id String @id @default(dbgenerated()) @db.Uuid
postId String postId String @db.Uuid
userId String userId String @db.Uuid
post Post @relation(fields: [postId], references: [id], onDelete: Cascade)
user User @relation(fields: [userId], references: [id], onDelete: Cascade) post Post @relation(fields: [postId], references: [id], onDelete: Cascade)
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
} }
model Comment { model Comment {
id String @id @default(cuid()) id String @id @default(dbgenerated()) @db.Uuid
message String message String
postId String postId String @db.Uuid
userId String userId String @db.Uuid
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]) 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