Skip to content

Commit

Permalink
Update mysql statements
Browse files Browse the repository at this point in the history
If you use a MySQL server, you can use the "json" instead of "longtext". If you still use MariaDB, the "json" will be translated back to "longtext". So this only has an impact on the aesthetics. In the newest MySQL version, integer must not contain length anymore. Also, the "Primary Key" should always have an integer as value, which is why all keys are placed on the id, and e.g. "plate" is treated as a normal key.

At last I set the charset to UTF8MB4.
  • Loading branch information
divide29 authored Mar 16, 2023
1 parent 56b45d1 commit 89a3e90
Showing 1 changed file with 26 additions and 26 deletions.
52 changes: 26 additions & 26 deletions qb-inventory.sql
Original file line number Diff line number Diff line change
@@ -1,50 +1,50 @@
CREATE TABLE IF NOT EXISTS `gloveboxitems` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`id` int NOT NULL AUTO_INCREMENT,
`plate` varchar(255) DEFAULT NULL,
`items` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
PRIMARY KEY (`plate`),
KEY `id` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=latin1;
`items` json DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `plate` (`plate`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE IF NOT EXISTS `stashitems` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`id` int NOT NULL AUTO_INCREMENT,
`stash` varchar(255) DEFAULT NULL,
`items` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
PRIMARY KEY (`stash`),
KEY `id` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=latin1;
`items` json DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `stash` (`stash`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE IF NOT EXISTS `trunkitems` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`id` int NOT NULL AUTO_INCREMENT,
`plate` varchar(255) DEFAULT NULL,
`items` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
PRIMARY KEY (`plate`),
KEY `id` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=latin1;
`items` json DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `plate` (`plate`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE IF NOT EXISTS `player_vehicles` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`id` int 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,
`mods` json DEFAULT NULL,
`plate` varchar(50) NOT NULL,
`fakeplate` varchar(50) DEFAULT NULL,
`garage` varchar(50) DEFAULT NULL,
`fuel` int(11) DEFAULT 100,
`fuel` int 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,
`state` int DEFAULT 1,
`depotprice` int NOT NULL DEFAULT 0,
`drivingdistance` int DEFAULT NULL,
`status` text DEFAULT NULL,
`balance` int(11) NOT NULL DEFAULT 0,
`paymentamount` int(11) NOT NULL DEFAULT 0,
`paymentsleft` int(11) NOT NULL DEFAULT 0,
`financetime` int(11) NOT NULL DEFAULT 0,
`balance` int NOT NULL DEFAULT 0,
`paymentamount` int NOT NULL DEFAULT 0,
`paymentsleft` int NOT NULL DEFAULT 0,
`financetime` int NOT NULL DEFAULT 0,
PRIMARY KEY (`id`),
KEY `plate` (`plate`),
KEY `citizenid` (`citizenid`),
KEY `license` (`license`)
) ENGINE=InnoDB AUTO_INCREMENT=1;
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

0 comments on commit 89a3e90

Please sign in to comment.