1 |
rakinar2 |
577 |
generator client { |
2 |
|
|
provider = "prisma-client-js" |
3 |
|
|
} |
4 |
|
|
|
5 |
|
|
datasource db { |
6 |
|
|
provider = "postgresql" |
7 |
|
|
url = env("DB_URL") |
8 |
|
|
} |
9 |
|
|
|
10 |
|
|
enum InfractionType { |
11 |
|
|
BAN |
12 |
|
|
KICK |
13 |
|
|
MUTE |
14 |
|
|
WARNING |
15 |
|
|
MASSBAN |
16 |
|
|
TEMPBAN |
17 |
|
|
SOFTBAN |
18 |
|
|
MASSKICK |
19 |
|
|
UNBAN |
20 |
|
|
UNMUTE |
21 |
|
|
BULK_DELETE_MESSAGE |
22 |
|
|
TIMEOUT |
23 |
|
|
TIMEOUT_REMOVE |
24 |
|
|
BEAN |
25 |
|
|
NOTE |
26 |
|
|
} |
27 |
|
|
|
28 |
|
|
model Infraction { |
29 |
|
|
id Int @id @default(autoincrement()) |
30 |
|
|
type InfractionType |
31 |
|
|
userId String |
32 |
|
|
guildId String |
33 |
|
|
reason String? |
34 |
|
|
moderatorId String |
35 |
|
|
expiresAt DateTime? |
36 |
|
|
metadata Json? |
37 |
|
|
createdAt DateTime @default(now()) |
38 |
|
|
updatedAt DateTime @default(now()) @updatedAt |
39 |
|
|
queueId Int? |
40 |
|
|
|
41 |
|
|
@@map("infractions") |
42 |
|
|
} |
43 |
|
|
|
44 |
|
|
model SpamRecord { |
45 |
|
|
id Int @id @default(autoincrement()) |
46 |
|
|
user_id String |
47 |
|
|
guild_id String |
48 |
|
|
level Int @default(1) |
49 |
|
|
createdAt DateTime @default(now()) |
50 |
|
|
updatedAt DateTime @default(now()) @updatedAt |
51 |
|
|
|
52 |
|
|
@@map("spam_records") |
53 |
|
|
} |
54 |
|
|
|
55 |
|
|
model Queue { |
56 |
|
|
id Int @id @default(autoincrement()) |
57 |
|
|
user_id String |
58 |
|
|
guild_id String |
59 |
|
|
channel_id String? |
60 |
|
|
message_id String? |
61 |
|
|
file_name String |
62 |
|
|
name String |
63 |
|
|
args String[] @default([]) |
64 |
|
|
createdAt DateTime @default(now()) |
65 |
|
|
willRunAt DateTime |
66 |
|
|
|
67 |
|
|
@@map("queues") |
68 |
|
|
} |
69 |
|
|
|
70 |
|
|
model Snippet { |
71 |
|
|
id Int @id @default(autoincrement()) |
72 |
|
|
name String |
73 |
|
|
user_id String |
74 |
|
|
guild_id String |
75 |
|
|
roles String[] @default([]) |
76 |
|
|
channels String[] @default([]) |
77 |
|
|
users String[] @default([]) |
78 |
|
|
attachments String[] @default([]) |
79 |
|
|
content String[] @default([]) |
80 |
|
|
randomize Boolean @default(false) |
81 |
|
|
permission_roles PermissionRole[] |
82 |
|
|
level Int? |
83 |
|
|
createdAt DateTime @default(now()) |
84 |
|
|
updatedAt DateTime @default(now()) @updatedAt |
85 |
|
|
|
86 |
|
|
@@map("snippets") |
87 |
|
|
} |
88 |
|
|
|
89 |
|
|
model ChannelLock { |
90 |
|
|
id Int @id @default(autoincrement()) |
91 |
|
|
guild_id String |
92 |
|
|
channel_id String |
93 |
|
|
permissions Json |
94 |
|
|
createdAt DateTime @default(now()) |
95 |
|
|
updatedAt DateTime @default(now()) @updatedAt |
96 |
|
|
|
97 |
|
|
@@map("channel_locks") |
98 |
|
|
} |
99 |
|
|
|
100 |
|
|
model PermissionRole { |
101 |
|
|
id Int @id @default(autoincrement()) |
102 |
|
|
name String |
103 |
|
|
guild_id String |
104 |
|
|
roles String[] @default([]) |
105 |
|
|
users String[] @default([]) |
106 |
|
|
grantedPermissions String[] @default([]) |
107 |
|
|
createdAt DateTime @default(now()) |
108 |
|
|
updatedAt DateTime @default(now()) @updatedAt |
109 |
|
|
snippet Snippet? @relation(fields: [snippetId], references: [id]) |
110 |
|
|
snippetId Int? |
111 |
|
|
|
112 |
|
|
@@map("permission_roles") |
113 |
|
|
} |
114 |
|
|
|
115 |
|
|
model PermissionOverwrite { |
116 |
|
|
id Int @id @default(autoincrement()) |
117 |
|
|
name String? |
118 |
|
|
guildId String |
119 |
|
|
roles String[] @default([]) |
120 |
|
|
users String[] @default([]) |
121 |
|
|
grantedPermissions String[] @default([]) |
122 |
|
|
createdAt DateTime @default(now()) |
123 |
|
|
updatedAt DateTime @default(now()) @updatedAt |
124 |
|
|
|
125 |
|
|
@@map("permission_overwrites") |
126 |
|
|
} |
127 |
|
|
|
128 |
|
|
model ReactionRole { |
129 |
|
|
id Int @id @default(autoincrement()) |
130 |
|
|
emoji String |
131 |
|
|
isBuiltInEmoji Boolean |
132 |
|
|
guildId String |
133 |
|
|
channelId String |
134 |
|
|
messageId String |
135 |
|
|
roles String[] |
136 |
|
|
requiredRoles String[] @default([]) |
137 |
|
|
blacklistedUsers String[] @default([]) |
138 |
|
|
requiredPermissions String[] @default([]) |
139 |
|
|
level Int? |
140 |
|
|
single Boolean @default(false) |
141 |
|
|
createdAt DateTime @default(now()) |
142 |
|
|
updatedAt DateTime @default(now()) @updatedAt |
143 |
|
|
|
144 |
|
|
@@map("reaction_roles") |
145 |
|
|
} |
146 |
|
|
|
147 |
|
|
model User { |
148 |
|
|
id Int @id @default(autoincrement()) |
149 |
|
|
name String? |
150 |
|
|
username String |
151 |
|
|
discordId String |
152 |
|
|
guilds String[] @default([]) |
153 |
|
|
password String |
154 |
|
|
token String? |
155 |
|
|
recoveryToken String? |
156 |
|
|
recoveryCode String? |
157 |
|
|
recoveryAttempts Int @default(0) |
158 |
|
|
recoveryTokenExpiresAt DateTime? |
159 |
|
|
createdAt DateTime @default(now()) |
160 |
|
|
tokenExpiresAt DateTime? |
161 |
|
|
updatedAt DateTime @default(now()) @updatedAt |
162 |
|
|
|
163 |
|
|
@@map("users") |
164 |
|
|
} |
165 |
|
|
|
166 |
|
|
model BoostRoleEntries { |
167 |
|
|
id Int @id @default(autoincrement()) |
168 |
|
|
role_id String |
169 |
|
|
user_id String |
170 |
|
|
guild_id String |
171 |
|
|
createdAt DateTime @default(now()) |
172 |
|
|
|
173 |
|
|
@@map("boost_role_entries") |
174 |
|
|
} |
175 |
|
|
|
176 |
|
|
model AfkEntry { |
177 |
|
|
id Int @id @default(autoincrement()) |
178 |
|
|
reason String? |
179 |
|
|
userId String |
180 |
|
|
guildId String |
181 |
|
|
mentions String[] @default([]) |
182 |
|
|
global Boolean @default(false) |
183 |
|
|
createdAt DateTime @default(now()) |
184 |
|
|
updatedAt DateTime @default(now()) @updatedAt |
185 |
|
|
|
186 |
|
|
@@map("afk_entries") |
187 |
|
|
} |
188 |
|
|
|
189 |
|
|
enum PermissionLogicMode { |
190 |
|
|
OR |
191 |
|
|
AND |
192 |
|
|
} |
193 |
|
|
|
194 |
|
|
// TODO: Add 'requiredPermissionOverwrites' field, type: @relation with PermissionOverwrite[] |
195 |
|
|
|
196 |
|
|
model CommandPermissionOverwrite { |
197 |
|
|
id Int @id @default(autoincrement()) |
198 |
|
|
guildId String |
199 |
|
|
commands String[] |
200 |
|
|
requiredPermissions String[] @default([]) |
201 |
|
|
requiredPermissionMode PermissionLogicMode @default(AND) |
202 |
|
|
mode PermissionLogicMode @default(AND) |
203 |
|
|
requiredRoles String[] @default([]) |
204 |
|
|
requiredUsers String[] @default([]) |
205 |
|
|
requiredChannels String[] @default([]) |
206 |
|
|
requiredLevel Int? |
207 |
|
|
createdAt DateTime @default(now()) |
208 |
|
|
updatedAt DateTime @default(now()) @updatedAt |
209 |
|
|
|
210 |
|
|
@@map("command_permission_overwrites") |
211 |
|
|
} |
212 |
|
|
|
213 |
|
|
model Ballot { |
214 |
|
|
id Int @id @default(autoincrement()) |
215 |
|
|
guildId String |
216 |
|
|
channelId String |
217 |
|
|
messageId String |
218 |
|
|
userId String |
219 |
|
|
content String |
220 |
|
|
anonymous Boolean @default(false) |
221 |
|
|
files String[] @default([]) |
222 |
|
|
upvotes String[] @default([]) |
223 |
|
|
downvotes String[] @default([]) |
224 |
|
|
createdAt DateTime @default(now()) |
225 |
|
|
updatedAt DateTime @default(now()) @updatedAt |
226 |
|
|
|
227 |
|
|
@@map("ballots") |
228 |
|
|
} |
229 |
|
|
|
230 |
|
|
model PermissionLevel { |
231 |
|
|
id Int @id @default(autoincrement()) |
232 |
|
|
guildId String |
233 |
|
|
level Int |
234 |
|
|
disabled Boolean @default(false) |
235 |
|
|
grantedPermissions String[] @default([]) |
236 |
|
|
roles String[] @default([]) |
237 |
|
|
users String[] @default([]) |
238 |
|
|
createdAt DateTime @default(now()) |
239 |
|
|
updatedAt DateTime @default(now()) @updatedAt |
240 |
|
|
|
241 |
|
|
@@map("permission_levels") |
242 |
|
|
} |
243 |
|
|
|
244 |
|
|
model Review { |
245 |
|
|
id Int @id @default(autoincrement()) |
246 |
|
|
reviewer String? |
247 |
|
|
content String |
248 |
|
|
rating Int |
249 |
|
|
discordId String? |
250 |
|
|
email String? |
251 |
|
|
aboutReviewer String? |
252 |
|
|
approved Boolean @default(false) |
253 |
|
|
createdAt DateTime @default(now()) |
254 |
|
|
updatedAt DateTime @default(now()) @updatedAt |
255 |
|
|
|
256 |
|
|
@@map("reviews") |
257 |
|
|
} |