-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.prisma
54 lines (49 loc) · 1.23 KB
/
schema.prisma
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "mongodb"
url = env("DATABASE_URL")
}
model User {
id String @id @map("_id")
email String @unique
name String?
posts Post[]
Comment Comment[]
}
model Post {
id String @id @map("_id")
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
title String
content String?
published Boolean @default(false)
viewCount Int @default(0)
author User? @relation(fields: [authorId], references: [id])
authorId Int?
comments Comment[]
}
model Comment {
id String @id @map("_id")
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
title String
content String?
published Boolean @default(false)
viewCount Int @default(0)
postId String?
post Post? @relation(fields: [postId], references: [id])
authorId Int?
user User? @relation(fields: [userId], references: [id])
userId Int?
}
model Other {
id String @id @map("_id")
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
title String
content String?
published Boolean @default(false)
viewCount Int @default(0)
}