-
Notifications
You must be signed in to change notification settings - Fork 155
/
qbx_core.sql
51 lines (47 loc) · 1.94 KB
/
qbx_core.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
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 COLUMN IF NOT EXISTS `last_logged_out` timestamp NULL DEFAULT NULL AFTER `last_updated`,
MODIFY COLUMN `name` varchar(255) NOT NULL COLLATE utf8mb4_unicode_ci;
ALTER TABLE `players`
ADD COLUMN IF NOT EXISTS `userId` INT UNSIGNED DEFAULT NULL AFTER `id`;
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 `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;