From 6f15c32c716d92facf04468c0a9061aa5362102e Mon Sep 17 00:00:00 2001 From: Matthew <22198949+mafewtm@users.noreply.github.com> Date: Mon, 17 Jun 2024 13:17:02 -0400 Subject: [PATCH] fix(sql): collate for qbox (#476) * fix(sql): collate for qbox * fix: separate sqls for the frameworks --- README.md | 2 +- mdt.sql | 22 ++++---- sql/qbcore.sql | 136 +++++++++++++++++++++++++++++++++++++++++++++++++ sql/qbox.sql | 136 +++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 284 insertions(+), 12 deletions(-) create mode 100644 sql/qbcore.sql create mode 100644 sql/qbox.sql diff --git a/README.md b/README.md index ee7f1f9b..591a7771 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,6 @@ For all support questions, ask in our [Discord](https://www.discord.gg/projectsl # Installation * Download ZIP * Drag and drop resource into your server files, make sure to remove -main in the folder name -* Run the attached SQL script (mdt.sql) # Weapon Info Export @@ -336,3 +335,4 @@ The below repos are direct forks of ps-mdt and have been edited to fit certain c * [ImXirvin](https://github.com/ImXirvin) * [lenzh](https://github.com/lenzh) * Everyone else that we may have missed, thank you! +* Open the sql folder and run the SQL script which corresponds to your framework diff --git a/mdt.sql b/mdt.sql index 64c658b0..ac5eff6b 100644 --- a/mdt.sql +++ b/mdt.sql @@ -9,7 +9,7 @@ CREATE TABLE IF NOT EXISTS `mdt_data` ( `fingerprint` VARCHAR(50) DEFAULT NULL, PRIMARY KEY (`cid`), KEY `id` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; CREATE TABLE IF NOT EXISTS `mdt_bulletin` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -19,7 +19,7 @@ CREATE TABLE IF NOT EXISTS `mdt_bulletin` ( `time` varchar(20) NOT NULL, `jobtype` VARCHAR(25) DEFAULT 'police', PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; CREATE TABLE IF NOT EXISTS `mdt_reports` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -34,7 +34,7 @@ CREATE TABLE IF NOT EXISTS `mdt_reports` ( `time` varchar(20) DEFAULT NULL, `jobtype` varchar(25) DEFAULT 'police', PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; CREATE TABLE IF NOT EXISTS `mdt_bolos` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -50,7 +50,7 @@ CREATE TABLE IF NOT EXISTS `mdt_bolos` ( `time` varchar(20) DEFAULT NULL, `jobtype` varchar(25) NOT NULL DEFAULT 'police', PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; CREATE TABLE IF NOT EXISTS `mdt_convictions` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -67,7 +67,7 @@ CREATE TABLE IF NOT EXISTS `mdt_convictions` ( `recsentence` int(11) DEFAULT 0, `time` varchar(20) DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; CREATE TABLE IF NOT EXISTS `mdt_incidents` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -81,7 +81,7 @@ CREATE TABLE IF NOT EXISTS `mdt_incidents` ( `time` varchar(20) DEFAULT NULL, `jobtype` varchar(25) NOT NULL DEFAULT 'police', PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; CREATE TABLE IF NOT EXISTS `mdt_logs` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -89,7 +89,7 @@ CREATE TABLE IF NOT EXISTS `mdt_logs` ( `time` varchar(20) DEFAULT NULL, `jobtype` varchar(25) DEFAULT 'police', PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; CREATE TABLE IF NOT EXISTS `mdt_vehicleinfo` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -100,7 +100,7 @@ CREATE TABLE IF NOT EXISTS `mdt_vehicleinfo` ( `image` text NOT NULL DEFAULT '', `points` int(11) DEFAULT 0, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; CREATE TABLE IF NOT EXISTS `mdt_weaponinfo` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -112,7 +112,7 @@ CREATE TABLE IF NOT EXISTS `mdt_weaponinfo` ( `image` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `serial` (`serial`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; CREATE TABLE IF NOT EXISTS `mdt_impound` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -121,7 +121,7 @@ CREATE TABLE IF NOT EXISTS `mdt_impound` ( `fee` int(11) DEFAULT NULL, `time` varchar(255) NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; CREATE TABLE IF NOT EXISTS `mdt_clocking` ( `id` int(10) NOT NULL AUTO_INCREMENT, @@ -133,4 +133,4 @@ CREATE TABLE IF NOT EXISTS `mdt_clocking` ( `total_time` int(10) NOT NULL DEFAULT '0', PRIMARY KEY (`user_id`) USING BTREE, KEY `id` (`id`) USING BTREE -) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; +) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; diff --git a/sql/qbcore.sql b/sql/qbcore.sql new file mode 100644 index 00000000..a9a43dc6 --- /dev/null +++ b/sql/qbcore.sql @@ -0,0 +1,136 @@ +CREATE TABLE IF NOT EXISTS `mdt_data` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `cid` VARCHAR(20) DEFAULT NULL, + `information` MEDIUMTEXT DEFAULT NULL, + `tags` TEXT NOT NULL, + `gallery` TEXT NOT NULL, + `jobtype` VARCHAR(25) DEFAULT 'police', + `pfp` TEXT DEFAULT NULL, + `fingerprint` VARCHAR(50) DEFAULT NULL, + PRIMARY KEY (`cid`), + KEY `id` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +CREATE TABLE IF NOT EXISTS `mdt_bulletin` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `title` TEXT NOT NULL, + `desc` TEXT NOT NULL, + `author` varchar(50) NOT NULL, + `time` varchar(20) NOT NULL, + `jobtype` VARCHAR(25) DEFAULT 'police', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +CREATE TABLE IF NOT EXISTS `mdt_reports` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `author` varchar(50) DEFAULT NULL, + `title` varchar(255) DEFAULT NULL, + `type` varchar(50) DEFAULT NULL, + `details` LONGTEXT DEFAULT NULL, + `tags` text DEFAULT NULL, + `officersinvolved` text DEFAULT NULL, + `civsinvolved` text DEFAULT NULL, + `gallery` text DEFAULT NULL, + `time` varchar(20) DEFAULT NULL, + `jobtype` varchar(25) DEFAULT 'police', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +CREATE TABLE IF NOT EXISTS `mdt_bolos` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `author` varchar(50) DEFAULT NULL, + `title` varchar(50) DEFAULT NULL, + `plate` varchar(50) DEFAULT NULL, + `owner` varchar(50) DEFAULT NULL, + `individual` varchar(50) DEFAULT NULL, + `detail` text DEFAULT NULL, + `tags` text DEFAULT NULL, + `gallery` text DEFAULT NULL, + `officersinvolved` text DEFAULT NULL, + `time` varchar(20) DEFAULT NULL, + `jobtype` varchar(25) NOT NULL DEFAULT 'police', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +CREATE TABLE IF NOT EXISTS `mdt_convictions` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `cid` varchar(50) DEFAULT NULL, + `linkedincident` int(11) NOT NULL DEFAULT 0, + `warrant` varchar(50) DEFAULT NULL, + `guilty` varchar(50) DEFAULT NULL, + `processed` varchar(50) DEFAULT NULL, + `associated` varchar(50) DEFAULT '0', + `charges` text DEFAULT NULL, + `fine` int(11) DEFAULT 0, + `sentence` int(11) DEFAULT 0, + `recfine` int(11) DEFAULT 0, + `recsentence` int(11) DEFAULT 0, + `time` varchar(20) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +CREATE TABLE IF NOT EXISTS `mdt_incidents` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `author` varchar(50) NOT NULL DEFAULT '', + `title` varchar(50) NOT NULL DEFAULT '0', + `details` LONGTEXT NOT NULL, + `tags` text NOT NULL, + `officersinvolved` text NOT NULL, + `civsinvolved` text NOT NULL, + `evidence` text NOT NULL, + `time` varchar(20) DEFAULT NULL, + `jobtype` varchar(25) NOT NULL DEFAULT 'police', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +CREATE TABLE IF NOT EXISTS `mdt_logs` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `text` text NOT NULL, + `time` varchar(20) DEFAULT NULL, + `jobtype` varchar(25) DEFAULT 'police', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +CREATE TABLE IF NOT EXISTS `mdt_vehicleinfo` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `plate` varchar(50) DEFAULT NULL, + `information` text NOT NULL DEFAULT '', + `stolen` tinyint(1) NOT NULL DEFAULT 0, + `code5` tinyint(1) NOT NULL DEFAULT 0, + `image` text NOT NULL DEFAULT '', + `points` int(11) DEFAULT 0, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +CREATE TABLE IF NOT EXISTS `mdt_weaponinfo` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `serial` varchar(50) DEFAULT NULL, + `owner` varchar(50) DEFAULT NULL, + `information` text NOT NULL DEFAULT '', + `weapClass` varchar(50) DEFAULT NULL, + `weapModel` varchar(50) DEFAULT NULL, + `image` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `serial` (`serial`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +CREATE TABLE IF NOT EXISTS `mdt_impound` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `vehicleid` int(11) NOT NULL, + `linkedreport` int(11) NOT NULL, + `fee` int(11) DEFAULT NULL, + `time` varchar(255) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +CREATE TABLE IF NOT EXISTS `mdt_clocking` ( + `id` int(10) NOT NULL AUTO_INCREMENT, + `user_id` varchar(50) NOT NULL DEFAULT '', + `firstname` varchar(255) NOT NULL DEFAULT '', + `lastname` varchar(255) NOT NULL DEFAULT '', + `clock_in_time` varchar(255) NOT NULL DEFAULT '', + `clock_out_time` varchar(50) DEFAULT NULL, + `total_time` int(10) NOT NULL DEFAULT '0', + PRIMARY KEY (`user_id`) USING BTREE, + KEY `id` (`id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; diff --git a/sql/qbox.sql b/sql/qbox.sql new file mode 100644 index 00000000..662ce44b --- /dev/null +++ b/sql/qbox.sql @@ -0,0 +1,136 @@ +CREATE TABLE IF NOT EXISTS `mdt_data` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `cid` VARCHAR(20) DEFAULT NULL, + `information` MEDIUMTEXT DEFAULT NULL, + `tags` TEXT NOT NULL, + `gallery` TEXT NOT NULL, + `jobtype` VARCHAR(25) DEFAULT 'police', + `pfp` TEXT DEFAULT NULL, + `fingerprint` VARCHAR(50) DEFAULT NULL, + PRIMARY KEY (`cid`), + KEY `id` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + +CREATE TABLE IF NOT EXISTS `mdt_bulletin` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `title` TEXT NOT NULL, + `desc` TEXT NOT NULL, + `author` varchar(50) NOT NULL, + `time` varchar(20) NOT NULL, + `jobtype` VARCHAR(25) DEFAULT 'police', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + +CREATE TABLE IF NOT EXISTS `mdt_reports` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `author` varchar(50) DEFAULT NULL, + `title` varchar(255) DEFAULT NULL, + `type` varchar(50) DEFAULT NULL, + `details` LONGTEXT DEFAULT NULL, + `tags` text DEFAULT NULL, + `officersinvolved` text DEFAULT NULL, + `civsinvolved` text DEFAULT NULL, + `gallery` text DEFAULT NULL, + `time` varchar(20) DEFAULT NULL, + `jobtype` varchar(25) DEFAULT 'police', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + +CREATE TABLE IF NOT EXISTS `mdt_bolos` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `author` varchar(50) DEFAULT NULL, + `title` varchar(50) DEFAULT NULL, + `plate` varchar(50) DEFAULT NULL, + `owner` varchar(50) DEFAULT NULL, + `individual` varchar(50) DEFAULT NULL, + `detail` text DEFAULT NULL, + `tags` text DEFAULT NULL, + `gallery` text DEFAULT NULL, + `officersinvolved` text DEFAULT NULL, + `time` varchar(20) DEFAULT NULL, + `jobtype` varchar(25) NOT NULL DEFAULT 'police', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + +CREATE TABLE IF NOT EXISTS `mdt_convictions` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `cid` varchar(50) DEFAULT NULL, + `linkedincident` int(11) NOT NULL DEFAULT 0, + `warrant` varchar(50) DEFAULT NULL, + `guilty` varchar(50) DEFAULT NULL, + `processed` varchar(50) DEFAULT NULL, + `associated` varchar(50) DEFAULT '0', + `charges` text DEFAULT NULL, + `fine` int(11) DEFAULT 0, + `sentence` int(11) DEFAULT 0, + `recfine` int(11) DEFAULT 0, + `recsentence` int(11) DEFAULT 0, + `time` varchar(20) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + +CREATE TABLE IF NOT EXISTS `mdt_incidents` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `author` varchar(50) NOT NULL DEFAULT '', + `title` varchar(50) NOT NULL DEFAULT '0', + `details` LONGTEXT NOT NULL, + `tags` text NOT NULL, + `officersinvolved` text NOT NULL, + `civsinvolved` text NOT NULL, + `evidence` text NOT NULL, + `time` varchar(20) DEFAULT NULL, + `jobtype` varchar(25) NOT NULL DEFAULT 'police', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + +CREATE TABLE IF NOT EXISTS `mdt_logs` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `text` text NOT NULL, + `time` varchar(20) DEFAULT NULL, + `jobtype` varchar(25) DEFAULT 'police', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + +CREATE TABLE IF NOT EXISTS `mdt_vehicleinfo` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `plate` varchar(50) DEFAULT NULL, + `information` text NOT NULL DEFAULT '', + `stolen` tinyint(1) NOT NULL DEFAULT 0, + `code5` tinyint(1) NOT NULL DEFAULT 0, + `image` text NOT NULL DEFAULT '', + `points` int(11) DEFAULT 0, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + +CREATE TABLE IF NOT EXISTS `mdt_weaponinfo` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `serial` varchar(50) DEFAULT NULL, + `owner` varchar(50) DEFAULT NULL, + `information` text NOT NULL DEFAULT '', + `weapClass` varchar(50) DEFAULT NULL, + `weapModel` varchar(50) DEFAULT NULL, + `image` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `serial` (`serial`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + +CREATE TABLE IF NOT EXISTS `mdt_impound` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `vehicleid` int(11) NOT NULL, + `linkedreport` int(11) NOT NULL, + `fee` int(11) DEFAULT NULL, + `time` varchar(255) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + +CREATE TABLE IF NOT EXISTS `mdt_clocking` ( + `id` int(10) NOT NULL AUTO_INCREMENT, + `user_id` varchar(50) NOT NULL DEFAULT '', + `firstname` varchar(255) NOT NULL DEFAULT '', + `lastname` varchar(255) NOT NULL DEFAULT '', + `clock_in_time` varchar(255) NOT NULL DEFAULT '', + `clock_out_time` varchar(50) DEFAULT NULL, + `total_time` int(10) NOT NULL DEFAULT '0', + PRIMARY KEY (`user_id`) USING BTREE, + KEY `id` (`id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;