Skip to content

Commit

Permalink
fix(sql): collate for qbox (#476)
Browse files Browse the repository at this point in the history
* fix(sql): collate for qbox

* fix: separate sqls for the frameworks
  • Loading branch information
mafewtm authored Jun 17, 2024
1 parent bfc1b7d commit 6f15c32
Show file tree
Hide file tree
Showing 4 changed files with 284 additions and 12 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
22 changes: 11 additions & 11 deletions mdt.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -81,15 +81,15 @@ 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,
`text` text NOT NULL,
`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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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;
136 changes: 136 additions & 0 deletions sql/qbcore.sql
Original file line number Diff line number Diff line change
@@ -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;
136 changes: 136 additions & 0 deletions sql/qbox.sql
Original file line number Diff line number Diff line change
@@ -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;

0 comments on commit 6f15c32

Please sign in to comment.