-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.prisma
146 lines (134 loc) · 5.17 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
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
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
model User {
id String @id @default(uuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
email String @unique
name String
picture String
contentful_token_read String?
logins Login[]
TeamUser TeamUser[]
ContentModel ContentModel[]
ContentModelVersion ContentModelVersion[]
stars ContentModelStar[]
}
model Login {
id String @id @default(uuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
auth0Id String @unique
user User @relation(fields: [userId], references: [id])
userId String
}
model Team {
id String @id @default(uuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
name String
slug String @unique
TeamUser TeamUser[]
ContentModel ContentModel[]
}
model TeamUser {
id String @id @default(uuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
user User @relation(fields: [userId], references: [id])
userId String
team Team @relation(fields: [teamId], references: [id])
teamId String
role String
}
enum ContentModelVisibility {
PUBLIC
UNLISTED
PRIVATE
}
model ContentModel {
id String @id @default(uuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
cms String
slug String @unique
title String
description String
user User @relation(fields: [userId], references: [id])
userId String
team Team? @relation(fields: [teamId], references: [id])
teamId String?
ogMetaImage CloudinaryAsset? @relation(fields: [ogMetaImageId], references: [id])
ogMetaImageId String?
versions ContentModelVersion[]
visibility ContentModelVisibility @default(PUBLIC)
Tag Tag? @relation(fields: [tagId], references: [id])
tagId String?
ContentModelTag ContentModelTag[]
stars ContentModelStar[]
}
model ContentModelVersion {
id String @id @default(uuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
contentModel ContentModel @relation(fields: [contentModelId], references: [id])
contentModelId String
name String
version Int
model Json
position Json
author User @relation(fields: [authorId], references: [id])
authorId String
image CloudinaryAsset? @relation("Image", fields: [imageId], references: [id])
imageId String?
imageNoConnections CloudinaryAsset? @relation("ImageNoConnections", fields: [imageNoConnectionsId], references: [id])
imageNoConnectionsId String?
}
model Tag {
id String @id @default(uuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
title String
slug String @unique
contentModels ContentModel[]
ContentModelTag ContentModelTag[]
}
model ContentModelTag {
id String @id @default(uuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
contentModel ContentModel @relation(fields: [contentModelId], references: [id])
contentModelId String
tag Tag @relation(fields: [tagId], references: [id])
tagId String
}
model CloudinaryAsset {
id String @id @default(uuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
public_id String @unique
version Int
signature String
width Int?
height Int?
resource_type String
type String
// Not actually used, here for Prisma's sake
imageContentModelVersion ContentModelVersion? @relation("Image")
imageNoConnectionsContentModelVersion ContentModelVersion? @relation("ImageNoConnections")
ContentModel ContentModel[]
}
model ContentModelStar {
id String @id @default(uuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
contentModel ContentModel @relation(fields: [contentModelId], references: [id])
contentModelId String
author User @relation(fields: [authorId], references: [id])
authorId String
}
generator client {
provider = "prisma-client-js"
}