forked from SSnowly/warden-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.prisma
173 lines (155 loc) · 4.2 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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "mysql"
url = env("DATABASE_URL")
}
model Users {
id String @id @unique @db.VarChar(32)
last_username String
avatar String
type UserType
status UserStatus @default(BLACKLISTED)
appeals Int @default(0)
reason String?
servers Imports[]
notes Notes[]
}
model Notes {
nId Int @id @default(autoincrement())
id String @db.VarChar(32)
note String @db.LongText()
addedBy String
createdAt DateTime @default(now())
user Users @relation(fields: [id], references: [id], onDelete: Cascade, onUpdate: Cascade)
staff Staff @relation(fields: [addedBy], references: [id])
}
model Imports {
id String @db.VarChar(32)
server String
roles String @db.MediumText()
type UserType
appealed Boolean @default(false)
reason String @default("Not Specified") @db.VarChar(256)
BadServer BadServers @relation(fields: [server], references: [id], onDelete: Cascade, onUpdate: Cascade)
User Users @relation(fields: [id], references: [id], onDelete: Cascade, onUpdate: Cascade)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@unique([id, server])
}
model BadServers {
id String @id @unique @db.VarChar(32)
name String
oldNames String? @db.LongText
type ServerType
addedBy String
invite String?
reason String @default("None provided")
staff Staff @relation(fields: [addedBy], references: [id], onDelete: NoAction, onUpdate: Cascade)
Users Imports[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model Staff {
id String @id @unique @db.VarChar(32)
role StaffRoles @default(ADMIN)
appeals Int @default(0)
BadServers BadServers[]
AuditLogs Logs[]
Notes Notes[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model Guild {
id String @id @unique @db.VarChar(32)
name String
logChannel String
punishments Punishments?
Bans Bans[]
Roles Roles[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model Punishments {
id String @id @unique @db.VarChar(32)
owner Punish @default(BAN)
supporter Punish @default(KICK)
leaker Punish @default(WARN)
cheater Punish @default(WARN)
other Punish @default(WARN)
enabled Boolean @default(false)
unban Boolean @default(false)
globalCheck Boolean @default(false)
guild Guild @relation(fields: [id], references: [id])
roleId String? @db.VarChar(32)
}
model Bans {
id String @id @db.VarChar(32)
guild String @db.VarChar(32)
Guild Guild @relation(fields: [guild], references: [id])
}
model Roles {
id String @id @db.VarChar(32)
roles String @db.LongText
guild String @db.VarChar(32)
Guild Guild @relation(fields: [guild], references: [id])
}
model Logs {
id Int @id @default(autoincrement())
executedBy String @db.VarChar(32)
action LogActions
message String @db.LongText
createdAt DateTime @default(now())
staffMember Staff @relation(fields: [executedBy], references: [id])
}
enum LogActions {
bad_server_added
bad_server_removed
bad_server_updated
user_appealed
user_updated
user_created
globalscan_start
globalscan_finish
staff_member_added
staff_member_removed
procfile_start
procfile_finish
note_added
note_removed
forcecheck_start
forcecheck_finish
}
enum Punish {
ROLE
WARN
KICK
BAN
}
enum UserStatus {
APPEALED
BLACKLISTED
PERM_BLACKLISTED
WHITELISTED
}
enum ServerType {
CHEATING
LEAKING
RESELLING
ADVERTISING
OTHER
}
enum UserType {
OTHER
LEAKER
CHEATER
SUPPORTER
OWNER
BOT
}
enum StaffRoles {
DEV
ADMIN
EXSTAFF
}