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 |
|
|
permissions String[] @default([]) |
82 |
|
|
permissionMode PermissionLogicMode @default(AND) |
83 |
|
|
level Int? |
84 |
|
|
createdAt DateTime @default(now()) |
85 |
|
|
updatedAt DateTime @default(now()) @updatedAt |
86 |
|
|
|
87 |
|
|
@@map("snippets") |
88 |
|
|
} |
89 |
|
|
|
90 |
|
|
model ChannelLock { |
91 |
|
|
id Int @id @default(autoincrement()) |
92 |
|
|
guild_id String |
93 |
|
|
channel_id String |
94 |
|
|
permissions Json |
95 |
|
|
createdAt DateTime @default(now()) |
96 |
|
|
updatedAt DateTime @default(now()) @updatedAt |
97 |
|
|
|
98 |
|
|
@@map("channel_locks") |
99 |
|
|
} |
100 |
|
|
|
101 |
|
|
model PermissionOverwrite { |
102 |
|
|
id Int @id @default(autoincrement()) |
103 |
|
|
name String? |
104 |
|
|
guildId String |
105 |
|
|
roles String[] @default([]) |
106 |
|
|
users String[] @default([]) |
107 |
|
|
grantedPermissions String[] @default([]) |
108 |
|
|
createdAt DateTime @default(now()) |
109 |
|
|
updatedAt DateTime @default(now()) @updatedAt |
110 |
|
|
|
111 |
|
|
@@map("permission_overwrites") |
112 |
|
|
} |
113 |
|
|
|
114 |
|
|
model ReactionRole { |
115 |
|
|
id Int @id @default(autoincrement()) |
116 |
|
|
emoji String |
117 |
|
|
isBuiltInEmoji Boolean |
118 |
|
|
guildId String |
119 |
|
|
channelId String |
120 |
|
|
messageId String |
121 |
|
|
roles String[] |
122 |
|
|
requiredRoles String[] @default([]) |
123 |
|
|
blacklistedUsers String[] @default([]) |
124 |
|
|
requiredPermissions String[] @default([]) |
125 |
|
|
level Int? |
126 |
|
|
single Boolean @default(false) |
127 |
|
|
createdAt DateTime @default(now()) |
128 |
|
|
updatedAt DateTime @default(now()) @updatedAt |
129 |
|
|
|
130 |
|
|
@@map("reaction_roles") |
131 |
|
|
} |
132 |
|
|
|
133 |
|
|
model User { |
134 |
|
|
id Int @id @default(autoincrement()) |
135 |
|
|
name String? |
136 |
|
|
username String |
137 |
|
|
discordId String |
138 |
|
|
guilds String[] @default([]) |
139 |
|
|
password String |
140 |
|
|
token String? |
141 |
|
|
recoveryToken String? |
142 |
|
|
recoveryCode String? |
143 |
|
|
recoveryAttempts Int @default(0) |
144 |
|
|
recoveryTokenExpiresAt DateTime? |
145 |
|
|
createdAt DateTime @default(now()) |
146 |
|
|
tokenExpiresAt DateTime? |
147 |
|
|
updatedAt DateTime @default(now()) @updatedAt |
148 |
|
|
|
149 |
|
|
@@map("users") |
150 |
|
|
} |
151 |
|
|
|
152 |
|
|
model BoostRoleEntries { |
153 |
|
|
id Int @id @default(autoincrement()) |
154 |
|
|
role_id String |
155 |
|
|
user_id String |
156 |
|
|
guild_id String |
157 |
|
|
createdAt DateTime @default(now()) |
158 |
|
|
|
159 |
|
|
@@map("boost_role_entries") |
160 |
|
|
} |
161 |
|
|
|
162 |
|
|
model AfkEntry { |
163 |
|
|
id Int @id @default(autoincrement()) |
164 |
|
|
reason String? |
165 |
|
|
userId String |
166 |
|
|
guildId String |
167 |
|
|
mentions String[] @default([]) |
168 |
|
|
global Boolean @default(false) |
169 |
|
|
createdAt DateTime @default(now()) |
170 |
|
|
updatedAt DateTime @default(now()) @updatedAt |
171 |
|
|
|
172 |
|
|
@@map("afk_entries") |
173 |
|
|
} |
174 |
|
|
|
175 |
|
|
enum PermissionLogicMode { |
176 |
|
|
OR |
177 |
|
|
AND |
178 |
|
|
} |
179 |
|
|
|
180 |
|
|
// TODO: Add 'requiredPermissionOverwrites' field, type: @relation with PermissionOverwrite[] |
181 |
|
|
|
182 |
|
|
model CommandPermissionOverwrite { |
183 |
|
|
id Int @id @default(autoincrement()) |
184 |
|
|
guildId String |
185 |
|
|
commands String[] |
186 |
|
|
requiredPermissions String[] @default([]) |
187 |
|
|
requiredPermissionMode PermissionLogicMode @default(AND) |
188 |
|
|
mode PermissionLogicMode @default(AND) |
189 |
|
|
requiredRoles String[] @default([]) |
190 |
|
|
requiredUsers String[] @default([]) |
191 |
|
|
requiredChannels String[] @default([]) |
192 |
|
|
requiredLevel Int? |
193 |
|
|
createdAt DateTime @default(now()) |
194 |
|
|
updatedAt DateTime @default(now()) @updatedAt |
195 |
|
|
|
196 |
|
|
@@map("command_permission_overwrites") |
197 |
|
|
} |
198 |
|
|
|
199 |
|
|
model Ballot { |
200 |
|
|
id Int @id @default(autoincrement()) |
201 |
|
|
guildId String |
202 |
|
|
channelId String |
203 |
|
|
messageId String |
204 |
|
|
userId String |
205 |
|
|
content String |
206 |
|
|
anonymous Boolean @default(false) |
207 |
|
|
files String[] @default([]) |
208 |
|
|
upvotes String[] @default([]) |
209 |
|
|
downvotes String[] @default([]) |
210 |
|
|
createdAt DateTime @default(now()) |
211 |
|
|
updatedAt DateTime @default(now()) @updatedAt |
212 |
|
|
|
213 |
|
|
@@map("ballots") |
214 |
|
|
} |
215 |
|
|
|
216 |
|
|
model PermissionLevel { |
217 |
|
|
id Int @id @default(autoincrement()) |
218 |
|
|
guildId String |
219 |
|
|
level Int |
220 |
|
|
disabled Boolean @default(false) |
221 |
|
|
grantedPermissions String[] @default([]) |
222 |
|
|
roles String[] @default([]) |
223 |
|
|
users String[] @default([]) |
224 |
|
|
createdAt DateTime @default(now()) |
225 |
|
|
updatedAt DateTime @default(now()) @updatedAt |
226 |
|
|
|
227 |
|
|
@@map("permission_levels") |
228 |
|
|
} |
229 |
|
|
|
230 |
|
|
model Review { |
231 |
|
|
id Int @id @default(autoincrement()) |
232 |
|
|
reviewer String? |
233 |
|
|
content String |
234 |
|
|
rating Int |
235 |
|
|
discordId String? |
236 |
|
|
email String? |
237 |
|
|
aboutReviewer String? |
238 |
|
|
approved Boolean @default(false) |
239 |
|
|
ip String? |
240 |
|
|
createdAt DateTime @default(now()) |
241 |
|
|
updatedAt DateTime @default(now()) @updatedAt |
242 |
|
|
|
243 |
|
|
@@map("reviews") |
244 |
|
|
} |
245 |
|
|
|
246 |
|
|
model VerificationEntry { |
247 |
|
|
id Int @id @default(autoincrement()) |
248 |
|
|
userId String |
249 |
|
|
token String @unique |
250 |
|
|
guildId String |
251 |
|
|
attempts Int @default(0) |
252 |
|
|
meta Json? |
253 |
|
|
createdAt DateTime @default(now()) |
254 |
|
|
updatedAt DateTime @default(now()) @updatedAt |
255 |
|
|
|
256 |
|
|
@@map("verification_entries") |
257 |
|
|
} |
258 |
|
|
|
259 |
|
|
model GlobalUserBan { |
260 |
|
|
id Int @id @default(autoincrement()) |
261 |
|
|
userId String @unique |
262 |
|
|
reason String? |
263 |
|
|
executorId String |
264 |
|
|
notified Boolean @default(false) |
265 |
|
|
createdAt DateTime @default(now()) |
266 |
|
|
updatedAt DateTime @default(now()) @updatedAt |
267 |
|
|
|
268 |
|
|
@@map("global_user_bans") |
269 |
|
|
} |
270 |
|
|
|
271 |
|
|
model UserStatistics { |
272 |
|
|
id Int @id @default(autoincrement()) |
273 |
|
|
userId String |
274 |
|
|
guildId String |
275 |
|
|
messagesSent Int @default(0) |
276 |
|
|
messagesEdited Int @default(0) |
277 |
|
|
messagesDeleted Int @default(0) |
278 |
|
|
createdAt DateTime @default(now()) |
279 |
|
|
updatedAt DateTime @default(now()) @updatedAt |
280 |
|
|
|
281 |
|
|
@@map("user_statistics") |
282 |
|
|
} |