-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.prisma
113 lines (104 loc) · 3.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
generator client {
provider = "prisma-client-js"
previewFeatures = ["postgresqlExtensions"]
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
directUrl = env("DATABASE_URL_UNPOOLED")
extensions = [vector]
}
model PostView {
id String @id @default(cuid())
slug String
visitedAt DateTime @default(now())
}
model News {
id String @id @default(cuid())
title String
url String @unique
sourceUrl String
thumbnailUrl String?
publishedAt DateTime
createdAt DateTime @default(now())
parsed Boolean @default(false)
body String?
byline String?
lang String?
length Int?
excerpt String?
siteName String?
sourceId Int?
source NewsSource? @relation(fields: [sourceId], references: [id])
searchQuery String?
vectorized Boolean @default(false)
filtered Boolean @default(false)
embedding Unsupported("vector(1536)")?
posts Post[]
coverImage String?
deletedAt DateTime?
sentToApproval Boolean @default(false)
telegramMessageId String?
telegramChatId String?
deletionReason String?
}
model NewsSource {
id Int @id @default(autoincrement())
name String @unique
url String @unique
lastUpdateAt DateTime @default(now())
isActive Boolean @default(true)
news News[]
}
model Post {
id String @id @default(cuid())
slug String @unique
title String
content String
createdAt DateTime @default(now())
coverImage String?
author Author @relation(fields: [authorId], references: [id])
authorId String
excerpt String?
publishedAt DateTime?
newId String?
postedToTwitter Boolean @default(false)
tweetId String?
postedToLinkedin Boolean @default(false)
linkedinPostId String?
postedToInstagram Boolean @default(false)
instagramMediaId String?
postedToFacebook Boolean @default(false)
facebookPostId String?
new News? @relation(fields: [newId], references: [id], onDelete: Cascade)
tags Tag[]
languages Languages[] @relation("PostLanguages")
}
model Languages {
id Int @id @default(autoincrement())
title String
content String
excerpt String?
locale String
postId String
post Post @relation("PostLanguages", fields: [postId], references: [id], onDelete: Cascade)
}
model Tag {
id Int @id @default(autoincrement())
nameEs String @unique
nameEn String @unique
posts Post[]
}
model Author {
id String @id @default(cuid())
name String
picture String
posts Post[]
}
model Users {
id String @id @default(cuid())
username String @unique
email String @unique
password String
createdAt DateTime @default(now())
}