forked from KeyAuth/KeyAuth-Source-Code
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdb_structure.sql
499 lines (414 loc) · 14.9 KB
/
db_structure.sql
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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `main`
--
-- --------------------------------------------------------
--
-- Table structure for table `acclogs`
--
CREATE TABLE `acclogs` (
`username` varchar(49) NOT NULL,
`date` varchar(10) NOT NULL,
`ip` varchar(45) NOT NULL,
`useragent` varchar(199) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `accounts`
--
CREATE TABLE `accounts` (
`username` varchar(65) COLLATE utf8_unicode_ci NOT NULL,
`email` varchar(65) COLLATE utf8_unicode_ci NOT NULL,
`password` varchar(65) COLLATE utf8_unicode_ci NOT NULL,
`ownerid` varchar(65) COLLATE utf8_unicode_ci DEFAULT NULL,
`role` varchar(65) COLLATE utf8_unicode_ci NOT NULL,
`app` varchar(65) COLLATE utf8_unicode_ci DEFAULT NULL,
`owner` varchar(49) COLLATE utf8_unicode_ci DEFAULT NULL,
`banned` varchar(99) COLLATE utf8_unicode_ci DEFAULT NULL,
`warning` varchar(999) COLLATE utf8_unicode_ci DEFAULT NULL,
`admin` int(1) NOT NULL DEFAULT '0',
`img` varchar(90) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'https://cdn.keyauth.win/assets/img/favicon.png',
`pp` varchar(49) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`balance` varchar(49) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`keylevels` varchar(49) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'N/A',
`expires` varchar(49) COLLATE utf8_unicode_ci DEFAULT NULL,
`registrationip` varchar(49) COLLATE utf8_unicode_ci DEFAULT NULL,
`lastip` varchar(49) COLLATE utf8_unicode_ci DEFAULT NULL,
`twofactor` int(1) NOT NULL DEFAULT '0',
`googleAuthCode` varchar(59) COLLATE utf8_unicode_ci DEFAULT NULL,
`darkmode` int(1) NOT NULL DEFAULT '0',
`acclogs` int(1) NOT NULL DEFAULT '1',
`format` varchar(99) COLLATE utf8_unicode_ci DEFAULT NULL,
`amount` int(3) DEFAULT NULL,
`lvl` int(3) DEFAULT NULL,
`note` varchar(49) COLLATE utf8_unicode_ci DEFAULT NULL,
`duration` int(3) DEFAULT NULL,
`lastreset` int(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `apps`
--
CREATE TABLE `apps` (
`owner` varchar(65) COLLATE utf8_unicode_ci NOT NULL,
`name` varchar(40) COLLATE utf8_unicode_ci NOT NULL,
`secret` varchar(65) COLLATE utf8_unicode_ci NOT NULL,
`ownerid` varchar(39) COLLATE utf8_unicode_ci NOT NULL,
`enabled` int(1) NOT NULL,
`banned` int(1) NOT NULL DEFAULT '0',
`paused` int(11) NOT NULL DEFAULT '0',
`hwidcheck` int(1) NOT NULL,
`vpnblock` int(1) NOT NULL DEFAULT '0',
`sellerkey` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
`ver` varchar(5) COLLATE utf8_unicode_ci NOT NULL DEFAULT '1.0',
`download` varchar(120) COLLATE utf8_unicode_ci DEFAULT NULL,
`hash` varchar(2000) COLLATE utf8_unicode_ci DEFAULT NULL,
`webhook` varchar(130) COLLATE utf8_unicode_ci DEFAULT NULL,
`resellerstore` varchar(69) COLLATE utf8_unicode_ci DEFAULT NULL,
`appdisabled` varchar(100) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'This application is disabled',
`usernametaken` varchar(100) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'Username Already Exists.',
`keynotfound` varchar(100) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'Key Not Found.',
`keyused` varchar(100) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'Key Already Used.',
`nosublevel` varchar(100) COLLATE utf8_unicode_ci DEFAULT 'There is no subscription created for your key level. Contact application developer.',
`usernamenotfound` varchar(100) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'Username not found.',
`passmismatch` varchar(100) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'Password does not match.',
`hwidmismatch` varchar(100) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'HWID Doesn''t match. Ask for key reset.',
`noactivesubs` varchar(100) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'No active subscriptions found.',
`hwidblacked` varchar(100) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'You''ve been blacklisted from our application',
`pausedsub` varchar(100) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'Your Key is paused and cannot be used at the moment.',
`vpnblocked` varchar(100) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'VPNs are disallowed on this application',
`keybanned` varchar(100) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'Your license is banned',
`userbanned` varchar(100) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'The user is banned',
`sessionunauthed` varchar(100) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'Session is not validated',
`hashcheckfail` varchar(100) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'This program hash does not match, make sure you''re using latest version',
`keyexpired` varchar(100) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'Key has expired.',
`sellixsecret` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL,
`sellixdayproduct` varchar(13) COLLATE utf8_unicode_ci DEFAULT NULL,
`sellixweekproduct` varchar(13) COLLATE utf8_unicode_ci DEFAULT NULL,
`sellixmonthproduct` varchar(13) COLLATE utf8_unicode_ci DEFAULT NULL,
`sellixlifetimeproduct` varchar(13) COLLATE utf8_unicode_ci DEFAULT NULL,
`shoppysecret` varchar(16) COLLATE utf8_unicode_ci DEFAULT NULL,
`shoppydayproduct` varchar(7) COLLATE utf8_unicode_ci DEFAULT NULL,
`shoppyweekproduct` varchar(7) COLLATE utf8_unicode_ci DEFAULT NULL,
`shoppymonthproduct` varchar(7) COLLATE utf8_unicode_ci DEFAULT NULL,
`shoppylifetimeproduct` varchar(7) COLLATE utf8_unicode_ci DEFAULT NULL,
`cooldown` int(10) NOT NULL DEFAULT '604800',
`panelstatus` int(1) NOT NULL DEFAULT '1',
`session` int(10) NOT NULL DEFAULT '21600',
`hashcheck` int(1) NOT NULL DEFAULT '0',
`webdownload` varchar(120) COLLATE utf8_unicode_ci DEFAULT NULL,
`customDomain` varchar(253) COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `bans`
--
CREATE TABLE `bans` (
`hwid` varchar(100) DEFAULT NULL,
`ip` varchar(49) DEFAULT NULL,
`type` varchar(5) NOT NULL,
`app` varchar(64) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `buttons`
--
CREATE TABLE `buttons` (
`text` varchar(99) NOT NULL,
`value` varchar(99) NOT NULL,
`app` varchar(64) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Table structure for table `chatmsgs`
--
CREATE TABLE `chatmsgs` (
`id` int(255) NOT NULL,
`author` varchar(70) NOT NULL,
`message` varchar(2000) NOT NULL,
`timestamp` int(10) NOT NULL,
`channel` varchar(50) NOT NULL,
`app` varchar(64) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Table structure for table `chatmutes`
--
CREATE TABLE `chatmutes` (
`id` int(11) NOT NULL,
`user` varchar(70) NOT NULL,
`time` int(10) NOT NULL,
`app` varchar(64) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Table structure for table `chats`
--
CREATE TABLE `chats` (
`id` int(11) NOT NULL,
`name` varchar(50) NOT NULL,
`delay` int(10) NOT NULL,
`app` varchar(64) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Table structure for table `files`
--
CREATE TABLE `files` (
`name` varchar(49) COLLATE utf8_unicode_ci NOT NULL,
`id` varchar(49) COLLATE utf8_unicode_ci NOT NULL,
`url` varchar(2048) COLLATE utf8_unicode_ci DEFAULT NULL,
`size` varchar(49) COLLATE utf8_unicode_ci NOT NULL,
`uploaddate` varchar(49) COLLATE utf8_unicode_ci NOT NULL,
`app` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
`authed` int(1) NOT NULL DEFAULT '1'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `keys`
--
CREATE TABLE `keys` (
`id` int(11) NOT NULL,
`key` varchar(49) COLLATE utf8_unicode_ci NOT NULL,
`note` varchar(69) COLLATE utf8_unicode_ci DEFAULT NULL,
`expires` varchar(49) COLLATE utf8_unicode_ci NOT NULL,
`status` varchar(49) COLLATE utf8_unicode_ci NOT NULL,
`level` varchar(12) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`genby` varchar(49) COLLATE utf8_unicode_ci NOT NULL,
`gendate` varchar(49) COLLATE utf8_unicode_ci NOT NULL,
`usedon` int(10) DEFAULT NULL,
`usedby` varchar(70) COLLATE utf8_unicode_ci DEFAULT NULL,
`app` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
`banned` varchar(99) COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `logs`
--
CREATE TABLE `logs` (
`logdate` varchar(49) COLLATE utf8_unicode_ci NOT NULL,
`logdata` varchar(275) COLLATE utf8_unicode_ci NOT NULL,
`credential` varchar(70) COLLATE utf8_unicode_ci DEFAULT NULL,
`pcuser` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL,
`logapp` varchar(64) COLLATE utf8_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `resets`
--
CREATE TABLE `resets` (
`secret` char(32) NOT NULL,
`email` varchar(65) NOT NULL,
`time` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Table structure for table `sessions`
--
CREATE TABLE `sessions` (
`id` varchar(10) NOT NULL,
`credential` varchar(255) DEFAULT NULL,
`app` varchar(64) NOT NULL,
`expiry` int(10) NOT NULL,
`enckey` varchar(64) NOT NULL,
`validated` int(1) NOT NULL DEFAULT '0',
`ip` varchar(45) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `subs`
--
CREATE TABLE `subs` (
`id` int(255) NOT NULL,
`user` varchar(49) NOT NULL,
`subscription` varchar(49) NOT NULL,
`expiry` varchar(49) NOT NULL,
`app` varchar(64) NOT NULL,
`key` varchar(49) DEFAULT NULL,
`paused` int(1) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `subscriptions`
--
CREATE TABLE `subscriptions` (
`id` int(11) NOT NULL,
`name` varchar(49) NOT NULL,
`level` varchar(49) NOT NULL,
`app` varchar(64) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE `users` (
`username` varchar(70) NOT NULL,
`password` varchar(70) DEFAULT NULL,
`hwid` varchar(2000) DEFAULT NULL,
`app` varchar(64) NOT NULL,
`owner` varchar(65) DEFAULT NULL,
`createdate` int(10) DEFAULT NULL,
`lastlogin` int(10) DEFAULT NULL,
`banned` varchar(99) DEFAULT NULL,
`ip` varchar(49) DEFAULT NULL,
`cooldown` int(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `usersOld`
--
CREATE TABLE `usersOld` (
`username` varchar(70) NOT NULL,
`password` varchar(70) DEFAULT NULL,
`hwid` varchar(2000) DEFAULT NULL,
`app` varchar(64) NOT NULL,
`owner` varchar(65) DEFAULT NULL,
`createdate` int(10) DEFAULT NULL,
`lastlogin` int(10) DEFAULT NULL,
`banned` varchar(99) DEFAULT NULL,
`ip` varchar(49) DEFAULT NULL,
`cooldown` int(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `uservars`
--
CREATE TABLE `uservars` (
`name` varchar(99) NOT NULL,
`data` varchar(500) NOT NULL,
`user` varchar(70) NOT NULL,
`app` varchar(64) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Table structure for table `vars`
--
CREATE TABLE `vars` (
`varid` varchar(49) NOT NULL,
`msg` varchar(20000) NOT NULL,
`app` varchar(64) NOT NULL,
`authed` int(1) NOT NULL DEFAULT '1'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `webhooks`
--
CREATE TABLE `webhooks` (
`webid` varchar(10) NOT NULL,
`baselink` varchar(200) NOT NULL,
`useragent` varchar(49) NOT NULL DEFAULT 'KeyAuth',
`app` varchar(64) NOT NULL,
`authed` int(1) NOT NULL DEFAULT '1'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Indexes for dumped tables
--
--
-- Indexes for table `accounts`
--
ALTER TABLE `accounts`
ADD PRIMARY KEY (`username`);
--
-- Indexes for table `buttons`
--
ALTER TABLE `buttons`
ADD UNIQUE KEY `value` (`value`,`app`);
--
-- Indexes for table `chatmsgs`
--
ALTER TABLE `chatmsgs`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `chatmutes`
--
ALTER TABLE `chatmutes`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `chats`
--
ALTER TABLE `chats`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `keys`
--
ALTER TABLE `keys`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `sessions`
--
ALTER TABLE `sessions`
ADD KEY `session index` (`id`,`app`);
--
-- Indexes for table `subs`
--
ALTER TABLE `subs`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `subscriptions`
--
ALTER TABLE `subscriptions`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `users`
--
ALTER TABLE `users`
ADD KEY `main index` (`username`,`app`) USING BTREE;
--
-- Indexes for table `usersOld`
--
ALTER TABLE `usersOld`
ADD KEY `username` (`username`,`app`) USING BTREE;
--
-- Indexes for table `uservars`
--
ALTER TABLE `uservars`
ADD UNIQUE KEY `user vars` (`name`,`user`,`app`);
--
-- Indexes for table `webhooks`
--
ALTER TABLE `webhooks`
ADD KEY `baselink` (`baselink`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `chatmsgs`
--
ALTER TABLE `chatmsgs`
MODIFY `id` int(255) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `chatmutes`
--
ALTER TABLE `chatmutes`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `chats`
--
ALTER TABLE `chats`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `keys`
--
ALTER TABLE `keys`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `subs`
--
ALTER TABLE `subs`
MODIFY `id` int(255) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `subscriptions`
--
ALTER TABLE `subscriptions`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;