Skip to content

Commit

Permalink
Merge pull request #67 from DiamondLightSource/bf_automation
Browse files Browse the repository at this point in the history
Old prod tables previously not added to the repo schema
  • Loading branch information
KarlLevik committed Mar 4, 2021
2 parents bd046f3 + 9dffa42 commit 2ff01dc
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
10 changes: 10 additions & 0 deletions schemas/ispyb/updates/2021_03_03_BF_automationError.sql
Original file line number Diff line number Diff line change
@@ -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';
18 changes: 18 additions & 0 deletions schemas/ispyb/updates/2021_03_03_BF_automationFault.sql
Original file line number Diff line number Diff line change
@@ -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';

0 comments on commit 2ff01dc

Please sign in to comment.