-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.prisma
77 lines (71 loc) · 2.02 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
datasource db {
provider = "cockroachdb"
url = env("DATABASE_URL")
}
generator client {
provider = "prisma-client-js"
binaryTargets = "native"
}
model User {
id Int @id @default(sequence())
email String @unique
name String?
verified Boolean @default(false)
about String?
website String?
other String?
avatar String?
cover String?
role String? @default("user")
hashedPassword String
salt String
resetToken String?
resetTokenExpiresAt DateTime?
Video Video[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
Comment Comment[]
Subscribers Subscribers[]
Cmmt Cmmt[]
}
model Comment {
id Int @id @default(sequence())
author User @relation(fields: [authorId], references: [id])
authorId Int
content String
videoId Int
rating Int?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model Video {
id Int @id @default(sequence())
title String
description String
author User? @relation(fields: [authorId], references: [id])
authorId Int
url String
thumbnail String?
tags String
published String
views Int? @default(0)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model Subscribers {
id Int @id @default(sequence())
author User? @relation(fields: [authorId], references: [id])
authorId Int
channel Int
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model Cmmt {
id Int @id @default(sequence())
content String
author User? @relation(fields: [authorId], references: [id])
authorId Int
parentId Int
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}