From 2a49a9808d2289f5258c4c7e713f6d1e77df8c5f Mon Sep 17 00:00:00 2001 From: Matthew <22198949+MafewTM@users.noreply.github.com> Date: Thu, 4 Jan 2024 21:03:35 -0500 Subject: [PATCH] fix: revert tooriginal schema from our recipe --- vehicles.sql | 42 ++++++++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/vehicles.sql b/vehicles.sql index 489a8f6..d5f7c00 100644 --- a/vehicles.sql +++ b/vehicles.sql @@ -1,20 +1,26 @@ CREATE TABLE IF NOT EXISTS `player_vehicles` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `license` varchar(50) NOT NULL, - `citizenid` varchar(50) NOT NULL, - `vehicle` varchar(50) DEFAULT NULL, - `hash` varchar(50) DEFAULT NULL, - `mods` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL, - `plate` varchar(15) NOT NULL, - PRIMARY KEY (`id`), - KEY `plate` (`plate`), - KEY `citizenid` (`citizenid`), - KEY `license` (`license`) + `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, + `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, + PRIMARY KEY (`id`), + KEY `plate` (`plate`), + KEY `citizenid` (`citizenid`), + KEY `license` (`license`) ) ENGINE=InnoDB AUTO_INCREMENT=1; - -ALTER TABLE `player_vehicles` -ADD UNIQUE INDEX UK_playervehicles_plate (plate); - -ALTER TABLE `player_vehicles` -ADD CONSTRAINT FK_playervehicles_players FOREIGN KEY (citizenid) -REFERENCES `players` (citizenid) ON DELETE CASCADE ON UPDATE CASCADE;