Skip to content
Snippets Groups Projects
Commit 08b20fdd authored by Yusuf Akgül's avatar Yusuf Akgül :hatching_chick:
Browse files

changed schema

parent e58516df
No related branches found
No related tags found
1 merge request!13Feat.next auth
Pipeline #35264 failed
...@@ -6,25 +6,52 @@ generator client { ...@@ -6,25 +6,52 @@ generator client {
} }
datasource db { datasource db {
provider = "sqlite" provider = "postgresql"
url = env("DATABASE_URL") url = env("DATABASE_URL")
} }
model Message { model User {
id Int @id @default(autoincrement()) id String @id @default(cuid())
author String? userName String @unique
gameId String? name String?
title 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 content String
likeCount Int? @default(0) likeCount Int? @default(0)
sentAt DateTime? @default(now()) gameId String?
updatedAt DateTime? @updatedAt
published Boolean @default(false)
userId String
user User @relation(fields: [userId], references: [id])
Comment Comment[]
Like Like[]
} }
model Like { model Like {
id Int @id @default(autoincrement()) id String @id @default(dbgenerated()) @db.Uuid
postId Int postId String
author String? userId String
gameId String? post Post @relation(fields: [postId], references: [id], onDelete: Cascade)
likedAt DateTime? @default(now()) user User @relation(fields: [userId], references: [id], onDelete: Cascade)
}
model Comment {
id String @id @default(cuid())
message String
postId String
userId String
createdAt DateTime @default(now())
post Post @relation(fields: [postId], references: [id], onDelete: Cascade)
user User @relation(fields: [userId], references: [id])
} }
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