Last active
September 1, 2017 20:10
-
-
Save robsimmons/28c9529900442d17eea19489c690f294 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE `feedback` ( | |
`job` int NOT NULL, | |
`task` char(20) NOT NULL, | |
`payload` longtext NOT NULL, | |
`timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
UNIQUE KEY `job` (`job`, `task`), | |
CONSTRAINT `feedback_job` FOREIGN KEY (`job`) REFERENCES `job` (`job`) ON DELETE CASCADE | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE `job` ( | |
`job` int NOT NULL AUTO_INCREMENT PRIMARY KEY, | |
`submission` INT NOT NULL, | |
`status` enum('waiting', 'assigned', 'partial', 'done', 'quarantined') NOT NULL DEFAULT 'waiting', | |
`payload` JSON NOT NULL, | |
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
`last_touched` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, | |
`worker` char(13) DEFAULT NULL, | |
UNIQUE KEY `submission` (`submission`), | |
KEY `status` (`status`), | |
CONSTRAINT `job_submission` FOREIGN KEY (`submission`) REFERENCES `submission` (`submission`) | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE `result` ( | |
`job` int NOT NULL, | |
`task` char(20) NOT NULL, | |
`payload` json NOT NULL, | |
`timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
UNIQUE KEY `job` (`job`, `task`), | |
CONSTRAINT `result_job` FOREIGN KEY (`job`) REFERENCES `job` (`job`) ON DELETE CASCADE | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE `submission` ( | |
`submission` int NOT NULL AUTO_INCREMENT PRIMARY KEY, | |
`hash` binary(20) NOT NULL, | |
`branch` char(16) NOT NULL, | |
`groupname` char(16) NOT NULL, | |
`type` enum('tests', 'compiler', 'sleep') NOT NULL, | |
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
UNIQUE KEY `hash` (`hash`, `branch`, `groupname`), | |
KEY `groupname` (`groupname`) | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE `worker` ( | |
`worker` int NOT NULL AUTO_INCREMENT PRIMARY KEY, | |
`finished` bool NOT NULL DEFAULT '0', | |
`status` enum('REQUESTED', 'STARTING', 'IDLE', 'IDLE_TASKED', 'WORKING', 'BORED', 'KILLED', 'KILLED_TASKED', 'LOST', 'LOST_TASKED', 'LOST_TERM') NOT NULL DEFAULT 'REQUESTED', | |
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
`last_touched` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, | |
`worker_ping` timestamp DEFAULT NULL, | |
`spinner_ping` timestamp DEFAULT NULL, | |
`job` int DEFAULT NULL, | |
`note` varchar(255) DEFAULT NULL, | |
UNIQUE KEY `job` (`job`), | |
CONSTRAINT `worker_job` FOREIGN KEY (`job`) REFERENCES `job` (`job`) | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE `worker_counter` ( | |
`type` char(10) NOT NULL PRIMARY KEY, | |
`next` int NOT NULL | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment