Unverified Commit 33dd4eff authored by Mael Gaonach's avatar Mael Gaonach
Browse files

wip

parent 45883fa2
DROP TABLE IF EXISTS `SSXExperiment`;
DROP TABLE IF EXISTS `SSXDataCollection`;
DROP TABLE IF EXISTS `SSXSample`;
DROP TABLE IF EXISTS `SSXBuffer`;
CREATE TABLE `SSXExperiment` (
`ssxExperimentId` int(11) unsigned PRIMARY KEY AUTO_INCREMENT,
`dataCollectionGroupId` int(11) NOT NULL,
......@@ -8,39 +14,33 @@ CREATE TABLE `SSXExperiment` (
`monoStripe` varchar(255) DEFAULT NULL,
`beamSize` int(11) DEFAULT NULL,
`temperature` int(11) DEFAULT NULL,
FOREIGN KEY (`dataCollectionGroupId`) REFERENCES `DataCollectionGroup` (`dataCollectionGroupId`) ON DELETE CASCADE ON UPDATE CASCADE
FOREIGN KEY (`dataCollectionGroupId`) REFERENCES `DataCollectionGroup`(`dataCollectionGroupId`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE = InnoDB AUTO_INCREMENT = 0 DEFAULT CHARSET = utf8mb4;
DROP TABLE IF EXISTS `SSXDataCollection`;
CREATE TABLE `SSXDataCollection` (
`ssxDataCollectionId` int(11) unsigned PRIMARY KEY AUTO_INCREMENT,
`dataCollectionId` int(11) NOT NULL,
`ssxSampleId` int(11) NOT NULL,
`repetitionRate` int(11) DEFAULT NULL,
`energyBandwidth` int(11) DEFAULT NULL,
`beamCenterX` int(11) DEFAULT NULL,
`beamCenterY` int(11) DEFAULT NULL,
`detDistance` int(11) DEFAULT NULL,
FOREIGN KEY (`dataCollectionId`) REFERENCES `DataCollection` (`dataCollectionId`) ON DELETE CASCADE ON UPDATE CASCADE,
FOREIGN KEY (`ssxSampleId`) REFERENCES `SSXSample` (`ssxSampleId`) ON DELETE CASCADE ON UPDATE CASCADE
CREATE TABLE `SSXBuffer` (
`ssxBufferId` int(11) unsigned PRIMARY KEY AUTO_INCREMENT,
`name` varchar(255) DEFAULT NULL
) ENGINE = InnoDB AUTO_INCREMENT = 0 DEFAULT CHARSET = utf8mb4;
DROP TABLE IF EXISTS `SSXSample`;
CREATE TABLE `SSXSample` (
`ssxSampleId` int(11) unsigned PRIMARY KEY AUTO_INCREMENT,
`ssxBufferId` int(11) NOT NULL,
`proteinId` int(11) NOT NULL,
`ssxBufferId` int(11) unsigned NOT NULL,
`proteinId` int(10) unsigned NOT NULL,
`avgXtalSize` int(11) DEFAULT NULL,
`xtalConcentration` int(11) DEFAULT NULL,
FOREIGN KEY (`ssxBufferId`) REFERENCES `SSXBuffer` (`ssxBufferId`) ON DELETE CASCADE ON UPDATE CASCADE,
FOREIGN KEY (`proteinId`) REFERENCES `Protein` (`proteinId`) ON DELETE CASCADE ON UPDATE CASCADE
FOREIGN KEY (`ssxBufferId`) REFERENCES `SSXBuffer`(`ssxBufferId`) ON DELETE CASCADE ON UPDATE CASCADE,
FOREIGN KEY (`proteinId`) REFERENCES `Protein`(`proteinId`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE = InnoDB AUTO_INCREMENT = 0 DEFAULT CHARSET = utf8mb4;
DROP TABLE IF EXISTS `SSXBuffer`;
CREATE TABLE `SSXBuffer` (
`ssxBufferId` int(11) unsigned PRIMARY KEY AUTO_INCREMENT,
`name` varchar(255) DEFAULT NULL
CREATE TABLE `SSXDataCollection` (
`ssxDataCollectionId` int(11) unsigned PRIMARY KEY AUTO_INCREMENT,
`dataCollectionId` int(10) unsigned NOT NULL,
`ssxSampleId` int(11) unsigned NOT NULL,
`repetitionRate` int(11) DEFAULT NULL,
`energyBandwidth` int(11) DEFAULT NULL,
`beamCenterX` int(11) DEFAULT NULL,
`beamCenterY` int(11) DEFAULT NULL,
`detDistance` int(11) DEFAULT NULL,
FOREIGN KEY (`dataCollectionId`) REFERENCES `DataCollection`(`dataCollectionId`) ON DELETE CASCADE ON UPDATE CASCADE,
FOREIGN KEY (`ssxSampleId`) REFERENCES `SSXSample`(`ssxSampleId`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE = InnoDB AUTO_INCREMENT = 0 DEFAULT CHARSET = utf8mb4;
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment