-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.prisma
141 lines (108 loc) · 3.21 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
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
model partnerLinks {
id String @id @unique @default(uuid())
partnerName String
partner partners @relation(fields: [partnerName], references: [name])
name String
emoji String
link String
}
model partners {
id String @id @unique @default(uuid())
name String @unique
logo String @unique
category String
owner String
ownerImage String
ownerLink String?
description String
long_description String
links partnerLinks[]
}
model applications {
creatorid String @db.VarChar(255)
owner users @relation(fields: [creatorid], references: [userid])
name String @db.VarChar(255)
logo String @default("/logo.png") @db.VarChar(255)
token String @unique @db.VarChar(255)
active Boolean @default(true)
permissions String[] @default(["global.*"])
}
model plugins {
id Int @id @default(autoincrement())
postid String @db.VarChar(255)
post posts @relation(fields: [postid], references: [postid])
type String @db.VarChar(255)
href String? @db.VarChar(255)
jsonData Json?
}
model comments {
creatorid String @db.VarChar(255)
user users @relation(fields: [creatorid], references: [userid])
caption String @db.VarChar(255)
image String? @db.VarChar(255)
post posts @relation(fields: [postid], references: [postid])
postid String @db.VarChar(255)
commentid String @id @unique @db.VarChar(255)
}
model upvotes {
id String @id @unique @default(uuid())
userid String @db.VarChar(255)
postid String @db.VarChar(255)
post posts @relation(fields: [postid], references: [postid])
}
model downvotes {
id String @id @unique @default(uuid())
userid String @db.VarChar(255)
postid String @db.VarChar(255)
post posts @relation(fields: [postid], references: [postid])
}
model following {
id String @id @unique @default(uuid())
userid String @db.VarChar(255)
user users @relation("user", fields: [userid], references: [userid])
targetid String @db.VarChar(255)
target users @relation("target", fields: [targetid], references: [userid])
}
model posts {
userid String @db.VarChar(255)
user users @relation(fields: [userid], references: [userid])
caption String @db.VarChar(255)
image String? @db.VarChar(255)
plugins plugins[]
type Int
postid String @id @unique @db.VarChar(255)
upvotes upvotes[]
downvotes downvotes[]
comments comments[]
createdat DateTime @default(now())
}
model users {
name String? @db.VarChar(255)
userid String @id @unique @db.VarChar(255)
discord_id String? @db.VarChar(255) @unique
usertag String @unique @db.VarChar(255)
bio String @default("None") @db.VarChar(255)
avatar String @default("/logo.png") @db.VarChar(255)
followers following[] @relation("target")
following following[] @relation("user")
badges String[]
state State @default(ACTIVE)
staff_perms String[] @default([])
applications applications[]
posts posts[]
comments comments[]
}
enum State {
ACTIVE
BANNED
VOTE_BANNED
FOLLOW_BANNED
PRIVATE
}