-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathschema.prisma
More file actions
408 lines (369 loc) · 11.1 KB
/
schema.prisma
File metadata and controls
408 lines (369 loc) · 11.1 KB
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
model User {
id String @id @default(cuid())
email String @unique
name String?
role Role @default(USER)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
books Book[]
comments Comment[]
movies Movie[]
posts Post[]
projects Project[]
snippets Snippet[]
commentReactions CommentReaction[]
@@map("users")
}
model Post {
id String @id @default(cuid())
title String
slug String @unique
summary String?
content String
date DateTime @default(now())
lastmod DateTime @updatedAt
tags String[]
categories String[]
images String[]
authors String[]
draft Boolean @default(true)
featured Boolean @default(false)
canonicalUrl String?
layout String?
bibliography String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
authorId String
author User @relation(fields: [authorId], references: [id])
@@map("posts")
}
model Project {
id String @id @default(cuid())
type String @default("self")
title String
slug String @unique
description String?
imgSrc String @default("")
url String?
repo String?
builtWith String[] @default([])
links Json?
content String?
date DateTime @default(now())
lastmod DateTime @updatedAt
draft Boolean @default(false)
featured Boolean @default(false)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
authorId String
author User @relation(fields: [authorId], references: [id])
@@map("projects")
}
model Snippet {
id String @id @default(cuid())
title String
slug String @unique
summary String?
content String
date DateTime @default(now())
lastmod DateTime @updatedAt
tags String[]
categories String[]
images String[]
authors String[]
draft Boolean @default(true)
featured Boolean @default(false)
layout String?
language String?
framework String?
difficulty String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
authorId String
author User @relation(fields: [authorId], references: [id])
@@map("snippets")
}
model Movie {
id String @id @default(cuid())
title String
slug String @unique
summary String?
content String
date DateTime @default(now())
lastmod DateTime @updatedAt
tags String[]
categories String[]
images String[]
authors String[]
draft Boolean @default(true)
featured Boolean @default(false)
layout String?
director String?
year Int?
titleType String?
yourRating Int?
imdbRating Float?
imdbUrl String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
authorId String
author User @relation(fields: [authorId], references: [id])
@@map("movies")
}
model Book {
id String @id @default(cuid())
title String
slug String @unique
summary String?
content String
date DateTime @default(now())
lastmod DateTime @updatedAt
tags String[]
categories String[]
images String[]
authors String[]
draft Boolean @default(true)
featured Boolean @default(false)
layout String?
bookAuthor String?
year Int?
pageCount Int?
userShelves String?
goodreadsUrl String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
authorId String
author User @relation(fields: [authorId], references: [id])
@@map("books")
}
model Stats {
type StatsType
slug String
views Int @default(0)
loves Int @default(0)
applauses Int @default(0)
ideas Int @default(0)
bullseyes Int @default(0)
@@id([type, slug])
@@map("stats")
}
model Product {
id String @id @default(cuid())
slug String @unique
name String
description String
shortDescription String
price Float
salePrice Float?
category String
tags String[]
images String[]
featured Boolean @default(false)
inStock Boolean @default(true)
stripeProductId String?
stripePriceId String?
specifications Json?
rating Float?
reviewCount Int?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
variants ProductVariant[]
reviews Review[]
@@map("products")
}
model ProductVariant {
id String @id @default(cuid())
name String
price Float
stripePriceId String?
attributes Json
inStock Boolean @default(true)
productId String
product Product @relation(fields: [productId], references: [id], onDelete: Cascade)
@@map("product_variants")
}
model Review {
id String @id @default(cuid())
author String
rating Int
comment String
date DateTime
verified Boolean @default(false)
productId String
product Product @relation(fields: [productId], references: [id], onDelete: Cascade)
@@map("reviews")
}
model GoodreadsBook {
id String @id
guid String
pubDate String
title String
link String
bookImageUrl String
bookSmallImageUrl String
bookMediumImageUrl String
bookLargeImageUrl String
bookDescription String
authorName String
isbn String?
userName String
userRating Float
userReadAt String?
userDateAdded String
userDateCreated String
userShelves String?
userReview String?
averageRating Float
bookPublished String?
numPages Int?
content String
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@map("goodreads_books")
}
model GoodreadsMovie {
id String @id
yourRating Float
dateRated String
title String
originalTitle String
url String
titleType String
imdbRating Float
runtime Float
year String?
genres String
numVotes Float
releaseDate String
directors String
actors String
plot String
poster String
language String
country String
awards String
boxOffice String?
totalSeasons String?
ratings Json
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@map("goodreads_movies")
}
model CaptainsLog {
id String @id @default(cuid())
timestamp DateTime @default(now())
transcription String
summary String?
contentType String
tags String[]
blogPotential Boolean @default(false)
projectPotential Boolean @default(false)
duration Int?
isPrivate Boolean @default(true)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@map("captains_logs")
}
model SiteSettings {
id String @id @default("default")
title String @default("Dana's dev blog – stories, insights, and ideas")
author String @default("Dana Davis")
headerTitle String @default("Dana's dev blog")
description String @default("A personal space on the cloud where I document my programming journey, sharing lessons, insights, and resources for fellow developers.")
language String @default("en-us")
locale String @default("en-US")
siteUrl String @default("https://danadavis.dev")
siteRepo String @default("https://github.com/xi-Rick/danadavis.dev")
siteLogo String @default("/static/images/logo.png")
socialBanner String @default("/static/images/twitter-card.jpeg")
faviconPath String @default("/favicon.ico")
email String @default("dana@danadavis.dev")
github String @default("https://github.com/xi-Rick")
x String @default("https://twitter.com/cortrale")
youtube String @default("https://youtube.com/@danadavisyt")
linkedin String @default("https://www.linkedin.com/in/danadavisdev/")
threads String @default("https://www.threads.net/cortrale")
instagram String @default("https://www.instagram.com/cortrale")
buyMeACoffee String @default("https://www.buymeacoffee.com/danadavis")
paypal String?
kofi String @default("https://ko-fi.com/danadavisdev")
goodreadsBookshelf String?
imdbRatingsList String?
umamiWebsiteId String?
umamiShareUrl String?
disqusShortname String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@map("site_settings")
}
model Comment {
id String @id @default(cuid())
postSlug String
parentId String?
content String
authorName String?
authorEmail String?
authorImage String?
isDeleted Boolean @default(false)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
authorId String?
author User? @relation(fields: [authorId], references: [id])
parent Comment? @relation("CommentChildren", fields: [parentId], references: [id])
replies Comment[] @relation("CommentChildren")
reactions CommentReaction[]
@@map("comments")
}
model CommentReaction {
id String @id @default(cuid())
commentId String
userId String
createdAt DateTime @default(now())
comment Comment @relation(fields: [commentId], references: [id], onDelete: Cascade)
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
@@unique([commentId, userId])
@@map("comment_reactions")
}
enum Role {
USER
ADMIN
}
enum StatsType {
blog
snippet
}
model ShopItem {
id String @id @default(cuid())
title String
slug String @unique
target Float?
contributed Float @default(0)
currency String @default("USD")
summary String
description String
images String[]
featured Boolean @default(false)
active Boolean @default(true)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
contributions Contribution[]
@@map("shop_items")
}
model Contribution {
id String @id @default(cuid())
shopItemId String
amount Float
currency String @default("USD")
stripeSessionId String? @unique
email String?
createdAt DateTime @default(now())
shopItem ShopItem @relation(fields: [shopItemId], references: [id], onDelete: Cascade)
@@map("contributions")
}