CREATE TABLE smd__task_queue (
	id INT auto_increment NOT NULL,
	name VARCHAR(64) NOT NULL,
	`type` set('consecutive','concurrent') DEFAULT 'consecutive' NOT NULL,
	priority INT DEFAULT 1000 NOT NULL,
	createDate TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,
	modifyDate TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,
	status SET('waiting','processing','processed','failed') DEFAULT 'waiting' NOT NULL,
	foreignData json NULL,
	foreignObjectId INT NULL,
	CONSTRAINT smd__task_queue_PK PRIMARY KEY (id)
)
ENGINE=InnoDB
DEFAULT CHARSET=utf8mb4
COLLATE=utf8mb4_general_ci;

INSERT INTO cron__jobs
(taskName, timing, status, lastRun, started, timeout, active)
VALUES('QueueConcurrentProcessing', 2, 'finished', '2022-08-25 07:37:20.0', '2022-08-25 07:37:20.0', 10, 'yes');
INSERT INTO cron__jobs
(taskName, timing, status, lastRun, started, timeout, active)
VALUES('QueueConsecutiveProcessing', 2, 'finished', '2022-08-25 07:37:20.0', '2022-08-25 07:37:20.0', 10, 'yes');
INSERT INTO cron__jobs
(taskName, timing, status, lastRun, started, timeout, active)
VALUES('QueueCleanUp', 2, 'finished', '2022-08-25 07:37:20.0', '2022-08-25 07:37:20.0', 10, 'yes');
