ed
This commit is contained in:
parent
48a36209b5
commit
884f3df7cf
262 changed files with 223207 additions and 2 deletions
232
resources/[jobs]/[mdt]/myMDT_core/sql/fresh_install.sql
Normal file
232
resources/[jobs]/[mdt]/myMDT_core/sql/fresh_install.sql
Normal file
|
|
@ -0,0 +1,232 @@
|
|||
CREATE TABLE `myemergency_files` (
|
||||
`id` VARCHAR(90) NOT NULL,
|
||||
`fromsystem` VARCHAR(50) NOT NULL DEFAULT 'police',
|
||||
`player_id` VARCHAR(90) NOT NULL DEFAULT '',
|
||||
`name` VARCHAR(90) NOT NULL DEFAULT '',
|
||||
`alias` VARCHAR(90) NOT NULL DEFAULT '',
|
||||
`sex` INT NOT NULL DEFAULT 0,
|
||||
`phone` VARCHAR(90) NOT NULL DEFAULT '',
|
||||
`size` VARCHAR(90) NOT NULL DEFAULT '',
|
||||
`birth` VARCHAR(90) NOT NULL DEFAULT '',
|
||||
`eyecolor` VARCHAR(90) NOT NULL DEFAULT '',
|
||||
`haircolor` VARCHAR(90) NOT NULL DEFAULT '',
|
||||
`blood_type` VARCHAR(10) NOT NULL DEFAULT 'A',
|
||||
`weight` VARCHAR(90) NOT NULL DEFAULT '',
|
||||
`allergies` TEXT,
|
||||
`known_illnesses` TEXT,
|
||||
`blackend` TINYINT(1) NOT NULL DEFAULT 0,
|
||||
`closed` TINYINT(1) NOT NULL DEFAULT 0,
|
||||
`createdby` varchar(90) NOT NULL DEFAULT '',
|
||||
`createddate` timestamp NOT NULL DEFAULT current_timestamp,
|
||||
`changedby` varchar(90) NOT NULL DEFAULT '',
|
||||
`changeddate` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE current_timestamp,
|
||||
PRIMARY KEY (`id`, `fromsystem`),
|
||||
INDEX `idx_type` (`fromsystem` ASC),
|
||||
INDEX `idx_name` (`name` ASC),
|
||||
INDEX `idx_alias` (`alias` ASC));
|
||||
|
||||
|
||||
|
||||
CREATE TABLE `myemergency_reg_vehicle` (
|
||||
`id` INT(11) NOT NULL AUTO_INCREMENT,
|
||||
`fromsystem` VARCHAR(50) NOT NULL DEFAULT 'police',
|
||||
`plate` VARCHAR(90) NOT NULL DEFAULT '',
|
||||
`owner` VARCHAR(90) NULL DEFAULT NULL,
|
||||
`veh_type` VARCHAR(90) NOT NULL DEFAULT '',
|
||||
`mot` VARCHAR(90) NOT NULL DEFAULT '',
|
||||
`veh_model` VARCHAR(90) NOT NULL DEFAULT '',
|
||||
`others` TEXT NOT NULL,
|
||||
`is_wanted` TINYINT(1) NOT NULL DEFAULT 0,
|
||||
`is_wanted_reason` VARCHAR(512) NOT NULL DEFAULT '',
|
||||
`color` VARCHAR(90) NOT NULL DEFAULT '',
|
||||
`mechanic_vehicle_state` INT NOT NULL DEFAULT 0,
|
||||
`createdby` varchar(90) NOT NULL DEFAULT '',
|
||||
`createddate` timestamp NOT NULL DEFAULT current_timestamp,
|
||||
`changedby` varchar(90) NOT NULL DEFAULT '',
|
||||
`changeddate` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE current_timestamp,
|
||||
PRIMARY KEY (`id`),
|
||||
INDEX `idx_owner` (`owner` ASC),
|
||||
INDEX `idx_plate` (`plate` ASC) ,
|
||||
INDEX `idx_veh_type` (`veh_type` ASC) ,
|
||||
INDEX `idx_veh_model` (`veh_model` ASC) );
|
||||
|
||||
|
||||
CREATE TABLE `myemergency_emergency_vehicle` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`fromsystem` VARCHAR(50) NOT NULL DEFAULT 'police',
|
||||
`name` varchar(90) NOT NULL DEFAULT '',
|
||||
`short_name` varchar(90) NOT NULL DEFAULT '',
|
||||
`vehicle` varchar(90) NOT NULL DEFAULT '',
|
||||
`radio_status_id` int(11) NOT NULL DEFAULT -1,
|
||||
`createdby` varchar(90) NOT NULL DEFAULT '',
|
||||
`createddate` timestamp NOT NULL DEFAULT current_timestamp(),
|
||||
`changedby` varchar(90) NOT NULL DEFAULT '',
|
||||
`changeddate` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_name` (`name`),
|
||||
KEY `idx_short_name` (`short_name`),
|
||||
KEY `idx_vehicle` (`vehicle`)
|
||||
);
|
||||
|
||||
|
||||
CREATE TABLE `myemergency_trainings` (
|
||||
`id` INT NOT NULL AUTO_INCREMENT,
|
||||
`fromsystem` VARCHAR(50) NOT NULL DEFAULT 'police',
|
||||
`name` VARCHAR(90) NOT NULL DEFAULT '',
|
||||
`short_name` VARCHAR(90) NOT NULL DEFAULT '',
|
||||
`content` TEXT,
|
||||
`allow_self_entry` TINYINT(1) NOT NULL DEFAULT 0,
|
||||
`min_rank_id` INT NOT NULL DEFAULT 0,
|
||||
`trainee` VARCHAR(90) NOT NULL DEFAULT '',
|
||||
`createdby` varchar(90) NOT NULL DEFAULT '',
|
||||
`createddate` timestamp NOT NULL DEFAULT current_timestamp,
|
||||
`changedby` varchar(90) NOT NULL DEFAULT '',
|
||||
`changeddate` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE current_timestamp,
|
||||
PRIMARY KEY (`id`),
|
||||
INDEX `idx_name` (`name` ASC) ,
|
||||
INDEX `idx_short_name` (`short_name` ASC) );
|
||||
|
||||
CREATE TABLE `myemergency_mission_reports` (
|
||||
`id` INT NOT NULL AUTO_INCREMENT,
|
||||
`fromsystem` VARCHAR(50) NOT NULL DEFAULT 'police',
|
||||
`name` VARCHAR(90) NOT NULL DEFAULT '',
|
||||
`mission_date` VARCHAR(90) NOT NULL DEFAULT '',
|
||||
`mission_location` VARCHAR(90) NOT NULL DEFAULT '',
|
||||
`involved_forces` VARCHAR(90) NOT NULL DEFAULT '',
|
||||
`report` TEXT,
|
||||
`createdby` VARCHAR(90) NOT NULL DEFAULT '',
|
||||
`createddate` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`changedby` VARCHAR(90) NOT NULL DEFAULT '',
|
||||
`changeddate` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
INDEX `idx_name` (`name` ASC) );
|
||||
|
||||
|
||||
CREATE TABLE `myemergency_employees` (
|
||||
`id` varchar(90) NOT NULL,
|
||||
`fromsystem` VARCHAR(50) NOT NULL DEFAULT 'police',
|
||||
`serviceno` VARCHAR(90),
|
||||
`is_suspended` tinyint(1) NOT NULL DEFAULT 0,
|
||||
`is_suspended_by` varchar(90) NOT NULL DEFAULT '',
|
||||
`is_suspended_date` timestamp,
|
||||
`is_control_centre` tinyint(1) NOT NULL DEFAULT 0,
|
||||
`emegency_vehicle_id` int NOT NULL DEFAULT -1,
|
||||
`radio_status_id` int NOT NULL DEFAULT -1,
|
||||
`createdby` varchar(90) NOT NULL DEFAULT '',
|
||||
`createddate` timestamp NOT NULL DEFAULT current_timestamp,
|
||||
`changedby` varchar(90) NOT NULL DEFAULT '',
|
||||
`changeddate` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE current_timestamp,
|
||||
PRIMARY KEY (`id`,`fromsystem`)
|
||||
);
|
||||
|
||||
|
||||
CREATE TABLE `myemergency_trainings_employees` (
|
||||
`id` INT NOT NULL AUTO_INCREMENT,
|
||||
`training_id` INT(11) NOT NULL,
|
||||
`employee_id` VARCHAR(90) NOT NULL,
|
||||
`fromsystem` VARCHAR(50) NOT NULL DEFAULT 'police',
|
||||
`passed` INT(11) NOT NULL DEFAULT -1,
|
||||
`createdby` VARCHAR(90) NOT NULL DEFAULT 0,
|
||||
`createddate` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP(),
|
||||
`changedby` VARCHAR(90) NOT NULL DEFAULT 0,
|
||||
`changeddate` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP() ON UPDATE CURRENT_TIMESTAMP(),
|
||||
PRIMARY KEY (`training_id`, `employee_id`),
|
||||
UNIQUE INDEX `id_UNIQUE` (`id` ASC) );
|
||||
|
||||
CREATE TABLE `myemergency_employees_entries` (
|
||||
`id` INT(11) NOT NULL AUTO_INCREMENT,
|
||||
`fromsystem` VARCHAR(50) NOT NULL DEFAULT 'police',
|
||||
`employee_id` VARCHAR(90) NOT NULL DEFAULT '',
|
||||
`content` TEXT,
|
||||
`type_of_entry` INT(11) NOT NULL DEFAULT 0,
|
||||
`closed` TINYINT(1) NOT NULL DEFAULT 0,
|
||||
`createdby` VARCHAR(90) NOT NULL DEFAULT '',
|
||||
`createddate` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP(),
|
||||
`changedby` VARCHAR(90) NOT NULL DEFAULT '',
|
||||
`changeddate` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP() ON UPDATE CURRENT_TIMESTAMP(),
|
||||
PRIMARY KEY (`id`),
|
||||
INDEX `idx_employee_id` (`employee_id` ASC));
|
||||
|
||||
|
||||
CREATE TABLE `myemergency_possible_rights` (
|
||||
`fromsystem` VARCHAR(50) NOT NULL DEFAULT '',
|
||||
`right_key` VARCHAR(90) NOT NULL DEFAULT '',
|
||||
`sortorder` INT NOT NULL,
|
||||
PRIMARY KEY (`fromsystem`, `right_key`),
|
||||
INDEX `idx_sortorder` (`sortorder` ASC) ,
|
||||
INDEX `idx_type` (`fromsystem` ASC) );
|
||||
|
||||
|
||||
CREATE TABLE `myemergency_rights` (
|
||||
`fromsystem` VARCHAR(50) NOT NULL DEFAULT 'police',
|
||||
`job_name` VARCHAR(90) NOT NULL DEFAULT 'police',
|
||||
`rank_id` INT NOT NULL DEFAULT -1,
|
||||
`rights_key` VARCHAR(90) NOT NULL DEFAULT '',
|
||||
`active` TINYINT(1) NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (`fromsystem`, `rights_key`, `rank_id`));
|
||||
|
||||
CREATE TABLE `mymdt_doc_head` (
|
||||
`id` INT NOT NULL AUTO_INCREMENT,
|
||||
`fromsystem` VARCHAR(50) NOT NULL DEFAULT '',
|
||||
`allow_decline` tinyint(1) NOT NULL default 1,
|
||||
`vehicle_id` INT NOT NULL DEFAULT -1,
|
||||
`doc_number` VARCHAR(90) NOT NULL default '',
|
||||
`declined` tinyint(1) NOT NULL default 0,
|
||||
`invoiced` tinyint(1) NOT NULL default 0,
|
||||
`done` tinyint(1) NOT NULL default 0,
|
||||
`totalprice_no_discount` int NOT NULL default 0,
|
||||
`totalprice_discount` int NOT NULL default 0,
|
||||
`createdby` VARCHAR(90) NOT NULL DEFAULT '',
|
||||
`createddate` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP(),
|
||||
`changedby` VARCHAR(90) NOT NULL DEFAULT '',
|
||||
`changeddate` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP() ON UPDATE CURRENT_TIMESTAMP(),
|
||||
UNIQUE INDEX `id_UNIQUE` (`id` ASC),
|
||||
PRIMARY KEY (`fromsystem`, `doc_number`));
|
||||
|
||||
CREATE TABLE `mymdt_doc_positions` (
|
||||
`id` INT NOT NULL AUTO_INCREMENT,
|
||||
`fromsystem` VARCHAR(50) NOT NULL,
|
||||
`head_doc_number` VARCHAR(90) NOT NULL,
|
||||
`positionNo` int NOT NULL,
|
||||
`pricelist_id` INT NOT NULL,
|
||||
`tuning_option_id` INT NOT NULL,
|
||||
`default_price` INT NOT NULL,
|
||||
`amount` INT NOT NULL,
|
||||
`total_price_no_discount` INT NOT NULL,
|
||||
`discount` INT NOT NULL,
|
||||
`total_price` INT NOT NULL,
|
||||
`createdby` VARCHAR(90) NOT NULL DEFAULT '',
|
||||
`createddate` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP(),
|
||||
`changedby` VARCHAR(90) NOT NULL DEFAULT '',
|
||||
`changeddate` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP() ON UPDATE CURRENT_TIMESTAMP(),
|
||||
UNIQUE INDEX `id_UNIQUE` (`id` ASC),
|
||||
PRIMARY KEY (`fromsystem`, `head_doc_number`, `positionNo`));
|
||||
|
||||
|
||||
|
||||
CREATE TABLE `mymdt_notes` (
|
||||
`id` INT NOT NULL AUTO_INCREMENT,
|
||||
`fromsystem` VARCHAR(50) NOT NULL,
|
||||
`is_important_note` TINYINT(1) NOT NULL DEFAULT 0,
|
||||
`note_headline` VARCHAR(512) NOT NULL DEFAULT '',
|
||||
`note` TEXT NOT NULL,
|
||||
`createdby` VARCHAR(90) NOT NULL DEFAULT '',
|
||||
`createddate` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP(),
|
||||
`changedby` VARCHAR(90) NOT NULL DEFAULT '',
|
||||
`changeddate` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP() ON UPDATE CURRENT_TIMESTAMP(),
|
||||
PRIMARY KEY (`id`));
|
||||
|
||||
|
||||
CREATE TABLE `myemergency_radio_state` (
|
||||
`id` INT NOT NULL AUTO_INCREMENT,
|
||||
`fromsystem` VARCHAR(50) NOT NULL DEFAULT 'police',
|
||||
`name` VARCHAR(90) NOT NULL DEFAULT '',
|
||||
`short_name` VARCHAR(90) NOT NULL DEFAULT '',
|
||||
`color` VARCHAR(90) NOT NULL DEFAULT '',
|
||||
`createdby` varchar(90) NOT NULL DEFAULT '',
|
||||
`createddate` timestamp NOT NULL DEFAULT current_timestamp,
|
||||
`changedby` varchar(90) NOT NULL DEFAULT '',
|
||||
`changeddate` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE current_timestamp,
|
||||
PRIMARY KEY (`id`),
|
||||
INDEX `idx_name` (`name` ASC) ,
|
||||
INDEX `idx_shortname` (`short_name` ASC) );
|
||||
53
resources/[jobs]/[mdt]/myMDT_core/sql/updates.sql
Normal file
53
resources/[jobs]/[mdt]/myMDT_core/sql/updates.sql
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
|
||||
ALTER TABLE `myemergency_reg_vehicle`
|
||||
ADD COLUMN `mechanic_vehicle_state` int NOT NULL DEFAULT 0;
|
||||
|
||||
|
||||
CREATE TABLE `mymdt_doc_head` (
|
||||
`id` INT NOT NULL AUTO_INCREMENT,
|
||||
`fromsystem` VARCHAR(50) NOT NULL DEFAULT '',
|
||||
`allow_decline` tinyint(1) NOT NULL default 1,
|
||||
`vehicle_id` INT NOT NULL DEFAULT -1,
|
||||
`doc_number` VARCHAR(90) NOT NULL default '',
|
||||
`declined` tinyint(1) NOT NULL default 0,
|
||||
`invoiced` tinyint(1) NOT NULL default 0,
|
||||
`done` tinyint(1) NOT NULL default 0,
|
||||
`totalprice_no_discount` int NOT NULL default 0,
|
||||
`totalprice_discount` int NOT NULL default 0,
|
||||
`createdby` VARCHAR(90) NOT NULL DEFAULT '',
|
||||
`createddate` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP(),
|
||||
`changedby` VARCHAR(90) NOT NULL DEFAULT '',
|
||||
`changeddate` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP() ON UPDATE CURRENT_TIMESTAMP(),
|
||||
UNIQUE INDEX `id_UNIQUE` (`id` ASC),
|
||||
PRIMARY KEY (`fromsystem`, `doc_number`));
|
||||
|
||||
CREATE TABLE `mymdt_doc_positions` (
|
||||
`id` INT NOT NULL AUTO_INCREMENT,
|
||||
`fromsystem` VARCHAR(50) NOT NULL,
|
||||
`head_doc_number` VARCHAR(90) NOT NULL,
|
||||
`positionNo` int NOT NULL,
|
||||
`pricelist_id` INT NOT NULL,
|
||||
`tuning_option_id` INT NOT NULL,
|
||||
`default_price` INT NOT NULL,
|
||||
`amount` INT NOT NULL,
|
||||
`total_price_no_discount` INT NOT NULL,
|
||||
`discount` INT NOT NULL,
|
||||
`total_price` INT NOT NULL,
|
||||
`createdby` VARCHAR(90) NOT NULL DEFAULT '',
|
||||
`createddate` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP(),
|
||||
`changedby` VARCHAR(90) NOT NULL DEFAULT '',
|
||||
`changeddate` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP() ON UPDATE CURRENT_TIMESTAMP(),
|
||||
UNIQUE INDEX `id_UNIQUE` (`id` ASC),
|
||||
PRIMARY KEY (`fromsystem`, `head_doc_number`, `positionNo`));
|
||||
|
||||
CREATE TABLE `mymdt_notes` (
|
||||
`id` INT NOT NULL AUTO_INCREMENT,
|
||||
`fromsystem` VARCHAR(50) NOT NULL,
|
||||
`is_important_note` TINYINT(1) NOT NULL DEFAULT 0,
|
||||
`note_headline` VARCHAR(512) NOT NULL DEFAULT '',
|
||||
`note` TEXT NOT NULL,
|
||||
`createdby` VARCHAR(90) NOT NULL DEFAULT '',
|
||||
`createddate` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP(),
|
||||
`changedby` VARCHAR(90) NOT NULL DEFAULT '',
|
||||
`changeddate` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP() ON UPDATE CURRENT_TIMESTAMP(),
|
||||
PRIMARY KEY (`id`));
|
||||
Loading…
Add table
Add a link
Reference in a new issue