diff --git a/schemas/ispyb/updates/2021_03_03_BF_automationError.sql b/schemas/ispyb/updates/2021_03_03_BF_automationError.sql new file mode 100644 index 00000000..2d283670 --- /dev/null +++ b/schemas/ispyb/updates/2021_03_03_BF_automationError.sql @@ -0,0 +1,10 @@ +INSERT IGNORE INTO SchemaStatus (scriptName, schemaStatus) VALUES ('2021_03_03_BF_automationError.sql', 'ONGOING'); + +CREATE TABLE `BF_automationError` ( + `automationErrorId` int(10) unsigned NOT NULL AUTO_INCREMENT, + `errorType` varchar(40) NOT NULL, + `solution` text DEFAULT NULL, + PRIMARY KEY (`automationErrorId`) +); + +UPDATE SchemaStatus SET schemaStatus = 'DONE' WHERE scriptName = '2021_03_03_BF_automationError.sql'; diff --git a/schemas/ispyb/updates/2021_03_03_BF_automationFault.sql b/schemas/ispyb/updates/2021_03_03_BF_automationFault.sql new file mode 100644 index 00000000..60e19d80 --- /dev/null +++ b/schemas/ispyb/updates/2021_03_03_BF_automationFault.sql @@ -0,0 +1,18 @@ +INSERT IGNORE INTO SchemaStatus (scriptName, schemaStatus) VALUES ('2021_03_03_BF_automationFault.sql', 'ONGOING'); + +CREATE TABLE `BF_automationFault` ( + `automationFaultId` int(10) unsigned NOT NULL AUTO_INCREMENT, + `automationErrorId` int(10) unsigned DEFAULT NULL, + `containerId` int(10) unsigned DEFAULT NULL, + `severity` enum('1','2','3') DEFAULT NULL, + `stacktrace` text DEFAULT NULL, + `resolved` tinyint(1) DEFAULT NULL, + `faultTimeStamp` timestamp NOT NULL DEFAULT current_timestamp(), + PRIMARY KEY (`automationFaultId`), + KEY `BF_automationFault_ibfk1` (`automationErrorId`), + KEY `BF_automationFault_ibfk2` (`containerId`), + CONSTRAINT `BF_automationFault_ibfk1` FOREIGN KEY (`automationErrorId`) REFERENCES `BF_automationError` (`automationErrorId`), + CONSTRAINT `BF_automationFault_ibfk2` FOREIGN KEY (`containerId`) REFERENCES `Container` (`containerId`) +); + +UPDATE SchemaStatus SET schemaStatus = 'DONE' WHERE scriptName = '2021_03_03_BF_automationFault.sql';