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 |
|
|
MASSKICK |
17 |
|
|
UNBAN |
18 |
|
|
UNMUTE |
19 |
|
|
BULK_DELETE_MESSAGE |
20 |
|
|
TIMEOUT |
21 |
|
|
TIMEOUT_REMOVE |
22 |
|
|
BEAN |
23 |
|
|
NOTE |
24 |
|
|
ROLE |
25 |
|
|
MOD_MESSAGE |
26 |
|
|
SHOT |
27 |
|
|
} |
28 |
|
|
|
29 |
|
|
enum InfractionDeliveryStatus { |
30 |
|
|
SUCCESS |
31 |
|
|
FALLBACK |
32 |
|
|
FAILED |
33 |
|
|
NOT_DELIVERED |
34 |
|
|
} |
35 |
|
|
|
36 |
|
|
model Infraction { |
37 |
|
|
id Int @id @default(autoincrement()) |
38 |
|
|
type InfractionType |
39 |
|
|
userId String |
40 |
|
|
guildId String |
41 |
|
|
reason String? |
42 |
|
|
moderatorId String |
43 |
|
|
expiresAt DateTime? |
44 |
|
|
metadata Json? |
45 |
|
|
deliveryStatus InfractionDeliveryStatus @default(SUCCESS) |
46 |
|
|
createdAt DateTime @default(now()) |
47 |
|
|
updatedAt DateTime @default(now()) @updatedAt |
48 |
|
|
queueId Int? |
49 |
|
|
|
50 |
|
|
@@map("infractions") |
51 |
|
|
} |
52 |
|
|
|
53 |
|
|
model PermissionOverwrite { |
54 |
|
|
id Int @id @default(autoincrement()) |
55 |
|
|
name String? |
56 |
|
|
guildId String |
57 |
|
|
roles String[] @default([]) |
58 |
|
|
users String[] @default([]) |
59 |
|
|
grantedDiscordPermissions String[] @default([]) |
60 |
|
|
grantedSystemPermissions String[] @default([]) |
61 |
|
|
priority Int @default(0) |
62 |
|
|
merge Boolean @default(true) |
63 |
|
|
disabled Boolean @default(false) |
64 |
|
|
createdAt DateTime @default(now()) |
65 |
|
|
updatedAt DateTime @default(now()) @updatedAt |
66 |
|
|
|
67 |
|
|
@@map("permission_overwrites") |
68 |
|
|
} |
69 |
|
|
|
70 |
|
|
model PermissionLevel { |
71 |
|
|
id Int @id @default(autoincrement()) |
72 |
|
|
guildId String |
73 |
|
|
level Int |
74 |
|
|
disabled Boolean @default(false) |
75 |
|
|
grantedDiscordPermissions String[] @default([]) |
76 |
|
|
grantedSystemPermissions String[] @default([]) |
77 |
|
|
roles String[] @default([]) |
78 |
|
|
users String[] @default([]) |
79 |
|
|
createdAt DateTime @default(now()) |
80 |
|
|
updatedAt DateTime @default(now()) @updatedAt |
81 |
|
|
|
82 |
|
|
@@map("permission_levels") |
83 |
|
|
} |
84 |
|
|
|
85 |
|
|
enum CommandPermissionOverwriteAction { |
86 |
|
|
ALLOW |
87 |
|
|
DENY |
88 |
|
|
} |
89 |
|
|
|
90 |
|
|
model CommandPermissionOverwrite { |
91 |
|
|
id Int @id @default(autoincrement()) |
92 |
|
|
guildId String |
93 |
|
|
commands String[] |
94 |
|
|
requiredDiscordPermissions Json @default("null") |
95 |
|
|
requiredSystemPermissions Json @default("null") |
96 |
|
|
requiredRoles Json @default("null") |
97 |
|
|
requiredUsers Json @default("null") |
98 |
|
|
requiredChannels Json @default("null") |
99 |
|
|
requiredLevel Int? |
100 |
|
|
disabled Boolean @default(false) |
101 |
|
|
onMatch CommandPermissionOverwriteAction @default(ALLOW) |
102 |
|
|
createdAt DateTime @default(now()) |
103 |
|
|
updatedAt DateTime @default(now()) @updatedAt |
104 |
|
|
|
105 |
|
|
@@map("command_permission_overwrites") |
106 |
|
|
} |
107 |
|
|
|
108 |
|
|
model Queue { |
109 |
|
|
id Int @id @default(autoincrement()) |
110 |
|
|
userId String |
111 |
|
|
guildId String |
112 |
|
|
channelId String? |
113 |
|
|
messageId String? |
114 |
|
|
name String |
115 |
|
|
repeat Boolean @default(false) |
116 |
|
|
data Json @default("{}") |
117 |
|
|
createdAt DateTime @default(now()) |
118 |
|
|
updatedAt DateTime @default(now()) @updatedAt |
119 |
|
|
runsAt DateTime? |
120 |
|
|
|
121 |
|
|
@@map("queues") |
122 |
|
|
} |
123 |
|
|
|
124 |
|
|
model MuteRecord { |
125 |
|
|
id Int @id @default(autoincrement()) |
126 |
|
|
memberId String |
127 |
|
|
guildId String |
128 |
|
|
roles String[] |
129 |
|
|
createdAt DateTime @default(now()) |
130 |
|
|
updatedAt DateTime @default(now()) @updatedAt |
131 |
|
|
|
132 |
|
|
@@map("mute_records") |
133 |
|
|
} |
134 |
|
|
|
135 |
|
|
model ChannelLock { |
136 |
|
|
id Int @id @default(autoincrement()) |
137 |
|
|
guildId String |
138 |
|
|
channelId String |
139 |
|
|
permissions Json |
140 |
|
|
createdAt DateTime @default(now()) |
141 |
|
|
updatedAt DateTime @default(now()) @updatedAt |
142 |
|
|
|
143 |
|
|
@@map("channel_locks") |
144 |
|
|
} |
145 |
|
|
|
146 |
|
|
model AfkEntry { |
147 |
|
|
id Int @id @default(autoincrement()) |
148 |
|
|
reason String? |
149 |
|
|
userId String |
150 |
|
|
guildId String |
151 |
|
|
mentions String[] @default([]) |
152 |
|
|
mentionCount Int @default(0) |
153 |
|
|
global Boolean @default(false) |
154 |
|
|
createdAt DateTime @default(now()) |
155 |
|
|
updatedAt DateTime @default(now()) @updatedAt |
156 |
|
|
|
157 |
|
|
@@map("afk_entries") |
158 |
|
|
} |
159 |
|
|
|
160 |
|
|
model User { |
161 |
|
|
id Int @id @default(autoincrement()) |
162 |
|
|
name String? |
163 |
|
|
username String |
164 |
|
|
discordId String |
165 |
|
|
githubId String? |
166 |
|
|
guilds String[] @default([]) |
167 |
|
|
password String |
168 |
|
|
token String? |
169 |
|
|
recoveryToken String? |
170 |
|
|
recoveryCode String? |
171 |
|
|
recoveryAttempts Int @default(0) |
172 |
|
|
recoveryTokenExpiresAt DateTime? |
173 |
|
|
createdAt DateTime @default(now()) |
174 |
|
|
tokenExpiresAt DateTime? |
175 |
|
|
updatedAt DateTime @default(now()) @updatedAt |
176 |
|
|
|
177 |
|
|
@@map("users") |
178 |
|
|
} |
179 |
|
|
|
180 |
|
|
model Snippet { |
181 |
|
|
id Int @id @default(autoincrement()) |
182 |
|
|
name String |
183 |
|
|
userId String |
184 |
|
|
guildId String |
185 |
|
|
aliases String[] @default([]) |
186 |
|
|
roles String[] @default([]) |
187 |
|
|
channels String[] @default([]) |
188 |
|
|
users String[] @default([]) |
189 |
|
|
attachments String[] @default([]) |
190 |
|
|
content String[] @default([]) |
191 |
|
|
randomize Boolean @default(false) |
192 |
|
|
permissions String[] @default([]) |
193 |
|
|
permissionMode PermissionLogicMode @default(AND) |
194 |
|
|
level Int? |
195 |
|
|
createdAt DateTime @default(now()) |
196 |
|
|
updatedAt DateTime @default(now()) @updatedAt |
197 |
|
|
|
198 |
|
|
@@map("snippets") |
199 |
|
|
} |
200 |
|
|
|
201 |
|
|
model ReactionRole { |
202 |
|
|
id Int @id @default(autoincrement()) |
203 |
|
|
emoji String |
204 |
|
|
isBuiltInEmoji Boolean |
205 |
|
|
guildId String |
206 |
|
|
channelId String |
207 |
|
|
messageId String |
208 |
|
|
roles String[] |
209 |
|
|
requiredRoles String[] @default([]) |
210 |
|
|
blacklistedUsers String[] @default([]) |
211 |
|
|
requiredPermissions String[] @default([]) |
212 |
|
|
level Int? |
213 |
|
|
single Boolean @default(false) |
214 |
|
|
createdAt DateTime @default(now()) |
215 |
|
|
updatedAt DateTime @default(now()) @updatedAt |
216 |
|
|
|
217 |
|
|
@@map("reaction_roles") |
218 |
|
|
} |
219 |
|
|
|
220 |
|
|
enum PermissionLogicMode { |
221 |
|
|
OR |
222 |
|
|
AND |
223 |
|
|
} |
224 |
|
|
|
225 |
|
|
model VerificationEntry { |
226 |
|
|
id Int @id @default(autoincrement()) |
227 |
|
|
userId String |
228 |
|
|
guildId String |
229 |
|
|
code String @unique |
230 |
|
|
attempts Int @default(0) |
231 |
|
|
metadata Json? |
232 |
|
|
expiresAt DateTime |
233 |
|
|
createdAt DateTime @default(now()) |
234 |
|
|
updatedAt DateTime @default(now()) @updatedAt |
235 |
|
|
|
236 |
|
|
@@unique([userId, guildId]) |
237 |
|
|
@@map("verification_entries") |
238 |
|
|
} |
239 |
|
|
|
240 |
|
|
model VerificationRecord { |
241 |
|
|
id Int @id @default(autoincrement()) |
242 |
|
|
guildId String |
243 |
|
|
userId String |
244 |
|
|
discordId String? |
245 |
|
|
githubId String? |
246 |
|
|
googleId String? |
247 |
|
|
email String? |
248 |
|
|
method VerificationMethod |
249 |
|
|
createdAt DateTime @default(now()) |
250 |
|
|
updatedAt DateTime @default(now()) @updatedAt |
251 |
|
|
|
252 |
|
|
@@map("verification_records") |
253 |
|
|
} |
254 |
|
|
|
255 |
|
|
enum VerificationMethod { |
256 |
|
|
DISCORD |
257 |
|
|
GITHUB |
258 |
|
|
GOOGLE |
259 |
|
|
EMAIL |
260 |
|
|
} |