CREATE TABLE `worker_queue` (
    `job_id` BIGINT(19) NOT NULL,
    `task_id` INT(10) NOT NULL,
    `job_start_time` DATETIME NULL DEFAULT NULL,
    `job_end_time` DATETIME NULL DEFAULT NULL,
    `state` TINYINT(1) NOT NULL DEFAULT '0',
    `state_description` ENUM('Pending','Processing','Completed','Failed') NOT NULL DEFAULT 'Pending',
    `file_name` VARCHAR(50) NULL DEFAULT NULL,
    `module_id` INT(10) NOT NULL,
    `id` INT(11) NOT NULL AUTO_INCREMENT,
    PRIMARY KEY (`id`) USING BTREE,
    INDEX `module id` (`module_id`) USING BTREE,
    CONSTRAINT `worker_queue_module_id` FOREIGN KEY (`module_id`) REFERENCES `modules` (`id`) ON UPDATE NO ACTION ON DELETE NO ACTION
)
ENGINE=InnoDB
;






CREATE TABLE `worker_queue_log` (
    `job_id` BIGINT(19) NOT NULL,
    `task_id` INT(10) NOT NULL,
    `job_start_time` DATETIME NULL DEFAULT NULL,
    `job_end_time` DATETIME NULL DEFAULT NULL,
    `state` TINYINT(1) NOT NULL DEFAULT '0',
    `state_description` ENUM('Pending','Processing','Completed','Failed') NOT NULL DEFAULT 'Pending',
    `file_name` VARCHAR(50) NULL DEFAULT NULL,
    `module_id` INT(10) NOT NULL,
    `id` INT(11) NOT NULL AUTO_INCREMENT,
    PRIMARY KEY (`id`) USING BTREE,
    INDEX `module id` (`module_id`) USING BTREE,
    CONSTRAINT `worker_queue_log_module_id` FOREIGN KEY (`module_id`) REFERENCES `modules` (`id`) ON UPDATE NO ACTION ON DELETE NO ACTION
)
ENGINE=InnoDB
;