-- ------------------------------------------ --
-- This update only For those who have an old jobpriority table, For new database, it is not need to be run.
-- ------------------------------------------ --
DROP TABLE IF EXISTS `jobpriority`;
CREATE TABLE `jobpriority`(
    `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
    `name` varchar(50) NOT NULL UNIQUE default '',
    `riskLevel` int(2) unsigned NOT NULL default '0',
    `active` tinyint(1) NOT NULL DEFAULT '1',
    `created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00',
    `createdById` int(10) unsigned NOT NULL DEFAULT '0',
    `updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    `updatedById` int(10) unsigned NOT NULL DEFAULT '0',
    PRIMARY KEY (`id`),
    UNIQUE INDEX (`name`),
    INDEX (`risklevel`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;


insert into `jobpriority` (name, riskLevel, created, createdById, updated, updatedById) VALUES ('LOW', 2, '2019-11-30 00:00:00', 10, '2019-11-30 00:00:00', 10);
insert into `jobpriority` (name, riskLevel, created, createdById, updated, updatedById) VALUES ('MID', 1, '2019-11-30 00:00:00', 10, '2019-11-30 00:00:00', 10);
insert into `jobpriority` (name, riskLevel, created, createdById, updated, updatedById) VALUES ('HIGH', 0, '2019-11-30 00:00:00', 10, '2019-11-30 00:00:00', 10);


TRUNCATE jobstatus;

insert into `jobstatus` (name, created, createdById, updated, updatedById) VALUES ('NEW', '2019-11-30 00:00:00', 10, '2019-11-30 00:00:00', 10);
insert into `jobstatus` (name, created, createdById, updated, updatedById) VALUES ('OPEN', '2019-11-30 00:00:00', 10, '2019-11-30 00:00:00', 10);
insert into `jobstatus` (name, created, createdById, updated, updatedById) VALUES ('WIP', '2019-11-30 00:00:00', 10, '2019-11-30 00:00:00', 10);
insert into `jobstatus` (name, created, createdById, updated, updatedById) VALUES ('CLOSED', '2019-11-30 00:00:00', 10, '2019-11-30 00:00:00', 10);
insert into `jobstatus` (name, created, createdById, updated, updatedById) VALUES ('COMPLETED', '2019-11-30 00:00:00', 10, '2019-11-30 00:00:00', 10);
insert into `jobstatus` (name, created, createdById, updated, updatedById) VALUES ('RNV', '2019-11-30 00:00:00', 10, '2019-11-30 00:00:00', 10);
insert into `jobstatus` (name, created, createdById, updated, updatedById) VALUES ('TAKEN', '2019-11-30 00:00:00', 10, '2019-11-30 00:00:00', 10);
