forked from Qbox-project/txAdminRecipe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
qbox.sql
321 lines (295 loc) · 13.5 KB
/
qbox.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
CREATE TABLE IF NOT EXISTS `apartments` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) DEFAULT NULL,
`type` varchar(255) DEFAULT NULL,
`label` varchar(255) DEFAULT NULL,
`citizenid` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `citizenid` (`citizenid`),
KEY `name` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE IF NOT EXISTS `bans` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(50) DEFAULT NULL,
`license` varchar(50) DEFAULT NULL,
`discord` varchar(50) DEFAULT NULL,
`ip` varchar(50) DEFAULT NULL,
`reason` text DEFAULT NULL,
`expire` int(11) DEFAULT NULL,
`bannedby` varchar(255) NOT NULL DEFAULT 'LeBanhammer',
PRIMARY KEY (`id`),
KEY `license` (`license`),
KEY `discord` (`discord`),
KEY `ip` (`ip`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE IF NOT EXISTS `dealers` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(50) NOT NULL DEFAULT '0',
`coords` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
`time` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
`createdby` varchar(50) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE IF NOT EXISTS `houselocations` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) DEFAULT NULL,
`label` varchar(255) DEFAULT NULL,
`coords` text DEFAULT NULL,
`owned` tinyint(1) DEFAULT NULL,
`price` int(11) DEFAULT NULL,
`tier` tinyint(4) DEFAULT NULL,
`garage` text DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `name` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE IF NOT EXISTS `player_houses` (
`id` int(255) NOT NULL AUTO_INCREMENT,
`house` varchar(50) NOT NULL,
`identifier` varchar(50) DEFAULT NULL,
`citizenid` varchar(50) DEFAULT NULL,
`keyholders` text DEFAULT NULL,
`decorations` text DEFAULT NULL,
`stash` text DEFAULT NULL,
`outfit` text DEFAULT NULL,
`logout` text DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `house` (`house`),
KEY `citizenid` (`citizenid`),
KEY `identifier` (`identifier`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE IF NOT EXISTS `house_plants` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`building` varchar(30) NOT NULL,
`stage` varchar(11) NOT NULL DEFAULT 'stage1',
`sort` varchar(30) NOT NULL,
`gender` enum('male', 'female') NOT NULL,
`food` tinyint NOT NULL DEFAULT 100,
`health` tinyint NOT NULL DEFAULT 100,
`progress` tinyint NOT NULL DEFAULT 0,
`coords` tinytext NOT NULL,
PRIMARY KEY (`id`),
KEY `building` (`building`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE IF NOT EXISTS `lapraces` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(50) DEFAULT NULL,
`checkpoints` text DEFAULT NULL,
`records` text DEFAULT NULL,
`creator` varchar(50) DEFAULT NULL,
`distance` int(11) DEFAULT NULL,
`raceid` varchar(50) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `raceid` (`raceid`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE IF NOT EXISTS `occasion_vehicles` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`seller` varchar(50) DEFAULT NULL,
`price` int(11) DEFAULT NULL,
`description` longtext DEFAULT NULL,
`plate` varchar(50) DEFAULT NULL,
`model` varchar(50) DEFAULT NULL,
`mods` text DEFAULT NULL,
`occasionid` varchar(50) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `occasionId` (`occasionid`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE IF NOT EXISTS `player_mails` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`citizenid` varchar(50) DEFAULT NULL,
`sender` varchar(50) DEFAULT NULL,
`subject` varchar(50) DEFAULT NULL,
`message` text DEFAULT NULL,
`read` tinyint(4) DEFAULT 0,
`mailid` int(11) DEFAULT NULL,
`date` timestamp NULL DEFAULT current_timestamp(),
`button` text DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `citizenid` (`citizenid`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE IF NOT EXISTS `players` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`citizenid` varchar(50) NOT NULL,
`cid` int(11) DEFAULT NULL,
`license` varchar(255) NOT NULL,
`name` varchar(255) NOT NULL,
`money` text NOT NULL,
`charinfo` text DEFAULT NULL,
`job` text NOT NULL,
`gang` text DEFAULT NULL,
`position` text NOT NULL,
`metadata` text NOT NULL,
`inventory` longtext DEFAULT NULL,
`phone_number` VARCHAR(20) DEFAULT NULL,
`last_updated` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
PRIMARY KEY (`citizenid`),
KEY `id` (`id`),
KEY `last_updated` (`last_updated`),
KEY `license` (`license`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
ALTER TABLE `players`
ADD IF NOT EXISTS `last_logged_out` timestamp NULL DEFAULT NULL AFTER `last_updated`,
MODIFY COLUMN `citizenid` varchar(50) NOT NULL COLLATE utf8mb4_unicode_ci;
CREATE TABLE IF NOT EXISTS `playerskins` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`citizenid` varchar(255) NOT NULL,
`model` varchar(255) NOT NULL,
`skin` text NOT NULL,
`active` tinyint(4) NOT NULL DEFAULT 1,
PRIMARY KEY (`id`),
KEY `citizenid` (`citizenid`),
KEY `active` (`active`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE IF NOT EXISTS `player_outfits` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`citizenid` varchar(50) DEFAULT NULL,
`outfitname` varchar(50) NOT NULL DEFAULT '0',
`model` varchar(50) DEFAULT NULL,
`props` text DEFAULT NULL,
`components` text DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `citizenid_outfitname_model` (`citizenid`,`outfitname`,`model`),
KEY `citizenid` (`citizenid`)
) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE IF NOT EXISTS `management_outfits` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`job_name` varchar(50) NOT NULL,
`type` varchar(50) NOT NULL,
`minrank` int(11) NOT NULL DEFAULT 0,
`name` varchar(50) NOT NULL DEFAULT 'Cool Outfit',
`gender` varchar(50) NOT NULL DEFAULT 'male',
`model` varchar(50) DEFAULT NULL,
`props` text DEFAULT NULL,
`components` text DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE IF NOT EXISTS `player_outfit_codes` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`outfitid` int(11) NOT NULL,
`code` varchar(50) NOT NULL DEFAULT '',
PRIMARY KEY (`id`),
KEY `FK_player_outfit_codes_player_outfits` (`outfitid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE IF NOT EXISTS `player_vehicles` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`license` varchar(50) DEFAULT NULL,
`citizenid` varchar(50) DEFAULT NULL,
`vehicle` varchar(50) DEFAULT NULL,
`hash` varchar(50) DEFAULT NULL,
`mods` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
`plate` varchar(50) NOT NULL,
`fakeplate` varchar(50) DEFAULT NULL,
`garage` varchar(50) DEFAULT NULL,
`fuel` int(11) DEFAULT 100,
`engine` float DEFAULT 1000,
`body` float DEFAULT 1000,
`state` int(11) DEFAULT 1,
`depotprice` int(11) NOT NULL DEFAULT 0,
`drivingdistance` int(50) DEFAULT NULL,
`status` text DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `plate` (`plate`),
KEY `citizenid` (`citizenid`),
KEY `license` (`license`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE IF NOT EXISTS `player_warns` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`senderIdentifier` varchar(50) DEFAULT NULL,
`targetIdentifier` varchar(50) DEFAULT NULL,
`reason` text DEFAULT NULL,
`warnId` varchar(50) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE IF NOT EXISTS `player_groups` (
`citizenid` VARCHAR(50) NOT NULL,
`group` VARCHAR(50) NOT NULL,
`type` VARCHAR(50) NOT NULL,
`grade` TINYINT(3) UNSIGNED NOT NULL,
PRIMARY KEY (`citizenid`, `type`, `group`),
CONSTRAINT `fk_citizenid` FOREIGN KEY (`citizenid`) REFERENCES `players` (`citizenid`) ON UPDATE CASCADE ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE IF NOT EXISTS `management_funds` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`job_name` VARCHAR(50) NOT NULL,
`amount` INT(100) NOT NULL,
`type` ENUM('boss','gang') NOT NULL DEFAULT 'boss',
PRIMARY KEY (`id`),
UNIQUE KEY `job_name` (`job_name`),
KEY `type` (`type`)
) DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
INSERT INTO `management_funds` (`job_name`, `amount`, `type`) VALUES
('police', 0, 'boss'),
('ambulance', 0, 'boss'),
('realestate', 0, 'boss'),
('taxi', 0, 'boss'),
('cardealer', 0, 'boss'),
('mechanic', 0, 'boss'),
('lostmc', 0, 'gang'),
('ballas', 0, 'gang'),
('vagos', 0, 'gang'),
('cartel', 0, 'gang'),
('families', 0, 'gang'),
('triads', 0, 'gang');
CREATE TABLE IF NOT EXISTS `ox_doorlock` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
`data` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
INSERT INTO `ox_doorlock` (`id`, `name`, `data`) VALUES
(1, 'vangelico_jewellery', '{"maxDistance":2,"groups":{"police":0},"doors":[{"model":1425919976,"coords":{"x":-631.9553833007813,"y":-236.33326721191407,"z":38.2065315246582},"heading":306},{"model":9467943,"coords":{"x":-630.426513671875,"y":-238.4375457763672,"z":38.2065315246582},"heading":306}],"state":1,"coords":{"x":-631.19091796875,"y":-237.38540649414063,"z":38.2065315246582},"hideUi":true}'),
(2, 'BigBankThermite1', '{"heading":160,"doors":false,"maxDistance":2,"hideUi":true,"groups":{"police":0},"coords":{"x":251.85757446289063,"y":221.0654754638672,"z":101.83240509033203},"model":-1508355822,"state":1,"autolock":1800}'),
(3, 'BigBankThermite2', '{"coords":{"x":261.3004150390625,"y":214.50514221191407,"z":101.83240509033203},"autolock":1800,"maxDistance":2,"groups":{"police":0},"model":-1508355822,"doors":false,"hideUi":true,"heading":250,"state":1}'),
(4, 'BigBankLPDoor', '{"coords":{"x":256.3115539550781,"y":220.65785217285157,"z":106.42955780029297},"autolock":1800,"maxDistance":2,"model":-222270721,"doors":false,"lockpick":true,"hideUi":true,"heading":340,"state":1,"lockpickDifficulty":["hard"]}'),
(5, 'PaletoThermiteDoor', '{"coords":{"x":-106.47130584716797,"y":6476.15771484375,"z":31.95479965209961},"autolock":1800,"maxDistance":2,"groups":{"police":0},"model":1309269072,"doors":false,"hideUi":true,"heading":315,"state":1}'),
(6, 'BigBankRedCardDoor', '{"coords":{"x":262.1980895996094,"y":222.518798828125,"z":106.42955780029297},"autolock":1800,"maxDistance":2,"groups":{"police":0},"model":746855201,"doors":false,"hideUi":true,"heading":250,"state":1}');
CREATE TABLE IF NOT EXISTS `bank_accounts_new` (
`id` varchar(50) NOT NULL,
`amount` int(11) DEFAULT 0,
`transactions` longtext,
`auth` longtext,
`isFrozen` int(11) DEFAULT 0,
`creator` varchar(50) DEFAULT NULL,
PRIMARY KEY (`id`)
) DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
INSERT INTO `bank_accounts_new` (`id`, `amount`, `transactions`, `auth`, `isFrozen`, `creator`) VALUES
('ambulance', 0, '[]', '[]', 0, NULL),
('cardealer', 0, '[]', '[]', 0, NULL),
('mechanic', 0, '[]', '[]', 0, NULL),
('police', 0, '[]', '[]', 0, NULL),
('realestate', 0, '[]', '[]', 0, NULL),
('lostmc', 0, '[]', '[]', 0, NULL),
('ballas', 0, '[]', '[]', 0, NULL),
('vagos', 0, '[]', '[]', 0, NULL),
('cartel', 0, '[]', '[]', 0, NULL),
('families', 0, '[]', '[]', 0, NULL),
('triads', 0, '[]', '[]', 0, NULL);
CREATE TABLE IF NOT EXISTS `player_transactions` (
`id` varchar(50) NOT NULL,
`isFrozen` int(11) DEFAULT 0,
`transactions` longtext,
PRIMARY KEY (`id`)
) DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE IF NOT EXISTS `vehicle_financing` (
`vehicleId` int(11) NOT NULL,
`balance` int(11) DEFAULT NULL,
`paymentamount` int(11) DEFAULT NULL,
`paymentsleft` int(11) DEFAULT NULL,
`financetime` int(11) DEFAULT NULL,
PRIMARY KEY (`vehicleId`),
FOREIGN KEY `vehicleId` (`vehicleId`) REFERENCES `player_vehicles` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE IF NOT EXISTS `properties` (
`id` INT NOT NULL AUTO_INCREMENT,
`property_name` VARCHAR(255) NOT NULL, /* simple label that can be used to identify which property it is. I.e. used for spawn list */
`coords` JSON NOT NULL, /* vec3 world coords for the entry position */
`price` INT NOT NULL DEFAULT 0,
`owner` VARCHAR(255), /* citizen ID of the owner */
`interior` VARCHAR(255) NOT NULL, /* the interior name, can range from IPL name to a shell hash that needs to spawn in */
`keyholders` JSON NOT NULL DEFAULT (JSON_OBJECT()), /* citizen IDs of other people that have access */
`rent_interval` INT DEFAULT NULL, /* the rent interval in hours */
`interact_options` JSON NOT NULL DEFAULT (JSON_OBJECT()), /* clothing and exit points */
`stash_options` JSON NOT NULL DEFAULT (JSON_OBJECT()), /* multiple stash support */
`decorations` JSON NOT NULL DEFAULT (JSON_OBJECT()), /* the model name with its corresponding coords that needs to be placed */
FOREIGN KEY (owner) REFERENCES `players` (`citizenid`),
PRIMARY KEY (id)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;