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 {
}
datasource db {
provider = "sqlite"
provider = "postgresql"
url = env("DATABASE_URL")
}
model Message {
id Int @id @default(autoincrement())
author String?
gameId String?
title String?
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[]
}
model Post {
id String @id @default(dbgenerated()) @db.Uuid
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
content String
likeCount Int? @default(0)
sentAt DateTime? @default(now())
updatedAt DateTime? @updatedAt
likeCount Int? @default(0)
gameId String?
published Boolean @default(false)
userId String
user User @relation(fields: [userId], references: [id])
Comment Comment[]
Like Like[]
}
model Like {
id Int @id @default(autoincrement())
postId Int
author String?
gameId String?
likedAt DateTime? @default(now())
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)
}
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