DROP TABLE IF EXISTS `jobstatus`;
CREATE TABLE `jobstatus`(
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(50) NOT NULL UNIQUE default '',
  `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`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

INSERT INTO `jobstatus` (name, active, created, createdById, updated, updatedById) VALUES
  ('NEW', 1, UTC_TIMESTAMP(), 10, UTC_TIMESTAMP(), 10),
  ('OPEN', 1, UTC_TIMESTAMP(), 10, UTC_TIMESTAMP(), 10),
  ('WIP', 1, UTC_TIMESTAMP(), 10, UTC_TIMESTAMP(), 10),
  ('RNV', 1, UTC_TIMESTAMP(), 10, UTC_TIMESTAMP(), 10),
  ('TAKEN', 1, UTC_TIMESTAMP(), 10, UTC_TIMESTAMP(), 10),
  ('TECH REPORT', 1, UTC_TIMESTAMP(), 10, UTC_TIMESTAMP(), 10),
  ('QUOTED', 1, UTC_TIMESTAMP(), 10, UTC_TIMESTAMP(), 10),
  ('APPROVED', 1, UTC_TIMESTAMP(), 10, UTC_TIMESTAMP(), 10),
  ('AWAITING PO', 1, UTC_TIMESTAMP(), 10, UTC_TIMESTAMP(), 10),
  ('AWAITING PARTS', 1, UTC_TIMESTAMP(), 10, UTC_TIMESTAMP(), 10),
  ('CLOSED', 1, UTC_TIMESTAMP(), 10, UTC_TIMESTAMP(), 10),
  ('COMPLETED', 1, UTC_TIMESTAMP(), 10, UTC_TIMESTAMP(), 10);
