From 672f2eddb527aa8ff0fab1cdc82a8c1c99456618 Mon Sep 17 00:00:00 2001 From: KarlLevik Date: Mon, 22 Aug 2022 11:57:58 +0000 Subject: [PATCH] Update database sql files --- schemas/ispyb/data.sql | 19 ++++++++++++++----- schemas/ispyb/lookups.sql | 5 ++++- schemas/ispyb/tables.sql | 18 ++++++++++++++++++ 3 files changed, 36 insertions(+), 6 deletions(-) diff --git a/schemas/ispyb/data.sql b/schemas/ispyb/data.sql index 7056eaf4..04a4f58f 100644 --- a/schemas/ispyb/data.sql +++ b/schemas/ispyb/data.sql @@ -261,6 +261,9 @@ INSERT INTO `BLSampleImageScore` (`blSampleImageScoreId`, `name`, `score`, `colo /*!40000 ALTER TABLE `BLSampleImage_has_AutoScoreClass` DISABLE KEYS */; /*!40000 ALTER TABLE `BLSampleImage_has_AutoScoreClass` ENABLE KEYS */; +/*!40000 ALTER TABLE `BLSampleImage_has_Positioner` DISABLE KEYS */; +/*!40000 ALTER TABLE `BLSampleImage_has_Positioner` ENABLE KEYS */; + /*!40000 ALTER TABLE `BLSampleType_has_Component` DISABLE KEYS */; /*!40000 ALTER TABLE `BLSampleType_has_Component` ENABLE KEYS */; @@ -305,7 +308,7 @@ INSERT INTO `BLSubSample` (`blSubSampleId`, `blSampleId`, `diffractionPlanId`, ` /*!40000 ALTER TABLE `BeamCentres` ENABLE KEYS */; /*!40000 ALTER TABLE `BeamLineSetup` DISABLE KEYS */; -INSERT INTO `BeamLineSetup` (`beamLineSetupId`, `detectorId`, `synchrotronMode`, `undulatorType1`, `undulatorType2`, `undulatorType3`, `focalSpotSizeAtSample`, `focusingOptic`, `beamDivergenceHorizontal`, `beamDivergenceVertical`, `polarisation`, `monochromatorType`, `setupDate`, `synchrotronName`, `maxExpTimePerDataCollection`, `maxExposureTimePerImage`, `minExposureTimePerImage`, `goniostatMaxOscillationSpeed`, `goniostatMaxOscillationWidth`, `goniostatMinOscillationWidth`, `maxTransmission`, `minTransmission`, `recordTimeStamp`, `CS`, `beamlineName`, `beamSizeXMin`, `beamSizeXMax`, `beamSizeYMin`, `beamSizeYMax`, `energyMin`, `energyMax`, `omegaMin`, `omegaMax`, `kappaMin`, `kappaMax`, `phiMin`, `phiMax`, `active`, `numberOfImagesMax`, `numberOfImagesMin`, `boxSizeXMin`, `boxSizeXMax`, `boxSizeYMin`, `boxSizeYMax`, `monoBandwidthMin`, `monoBandwidthMax`, `preferredDataCentre`) VALUES (1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2007-04-26 00:00:00','Diamond Light Source',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2016-03-19 22:56:25',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); +INSERT INTO `BeamLineSetup` (`beamLineSetupId`, `detectorId`, `synchrotronMode`, `undulatorType1`, `undulatorType2`, `undulatorType3`, `focalSpotSizeAtSample`, `focusingOptic`, `beamDivergenceHorizontal`, `beamDivergenceVertical`, `polarisation`, `monochromatorType`, `setupDate`, `synchrotronName`, `maxExpTimePerDataCollection`, `maxExposureTimePerImage`, `minExposureTimePerImage`, `goniostatMaxOscillationSpeed`, `goniostatMaxOscillationWidth`, `goniostatMinOscillationWidth`, `maxTransmission`, `minTransmission`, `recordTimeStamp`, `CS`, `beamlineName`, `beamSizeXMin`, `beamSizeXMax`, `beamSizeYMin`, `beamSizeYMax`, `energyMin`, `energyMax`, `omegaMin`, `omegaMax`, `kappaMin`, `kappaMax`, `phiMin`, `phiMax`, `active`, `numberOfImagesMax`, `numberOfImagesMin`, `boxSizeXMin`, `boxSizeXMax`, `boxSizeYMin`, `boxSizeYMax`, `monoBandwidthMin`, `monoBandwidthMax`, `preferredDataCentre`, `amplitudeContrast`) VALUES (1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2007-04-26 00:00:00','Diamond Light Source',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2016-03-19 22:56:25',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); /*!40000 ALTER TABLE `BeamLineSetup` ENABLE KEYS */; /*!40000 ALTER TABLE `BeamlineAction` DISABLE KEYS */; @@ -468,9 +471,9 @@ INSERT INTO `Dewar` (`dewarId`, `shippingId`, `code`, `comments`, `storageLocati /*!40000 ALTER TABLE `DewarTransportHistory` ENABLE KEYS */; /*!40000 ALTER TABLE `DiffractionPlan` DISABLE KEYS */; -INSERT INTO `DiffractionPlan` (`diffractionPlanId`, `name`, `experimentKind`, `observedResolution`, `minimalResolution`, `exposureTime`, `oscillationRange`, `maximalResolution`, `screeningResolution`, `radiationSensitivity`, `anomalousScatterer`, `preferredBeamSizeX`, `preferredBeamSizeY`, `preferredBeamDiameter`, `comments`, `DIFFRACTIONPLANUUID`, `aimedCompleteness`, `aimedIOverSigmaAtHighestRes`, `aimedMultiplicity`, `aimedResolution`, `anomalousData`, `complexity`, `estimateRadiationDamage`, `forcedSpaceGroup`, `requiredCompleteness`, `requiredMultiplicity`, `requiredResolution`, `strategyOption`, `kappaStrategyOption`, `numberOfPositions`, `minDimAccrossSpindleAxis`, `maxDimAccrossSpindleAxis`, `radiationSensitivityBeta`, `radiationSensitivityGamma`, `minOscWidth`, `recordTimeStamp`, `monochromator`, `energy`, `transmission`, `boxSizeX`, `boxSizeY`, `kappaStart`, `axisStart`, `axisRange`, `numberOfImages`, `presetForProposalId`, `beamLineName`, `detectorId`, `distance`, `orientation`, `monoBandwidth`, `centringMethod`, `userPath`, `robotPlateTemperature`, `exposureTemperature`, `experimentTypeId`, `purificationColumnId`, `collectionMode`, `priority`, `qMin`, `qMax`, `reductionParametersAveraging`) VALUES (197784,NULL,'OSC',NULL,NULL,0.2,NULL,NULL,NULL,NULL,NULL,10.5,10.5,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,0,NULL,NULL,NULL,1.1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2016-03-20 23:50:27',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), -(197788,NULL,NULL,NULL,NULL,10,NULL,NULL,NULL,NULL,NULL,160,100,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2016-10-26 15:28:12',NULL,150,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,4,162.5,45,330.6,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), -(197792,'XPDF-1',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2017-03-22 10:56:32',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); +INSERT INTO `DiffractionPlan` (`diffractionPlanId`, `name`, `experimentKind`, `observedResolution`, `minimalResolution`, `exposureTime`, `oscillationRange`, `maximalResolution`, `screeningResolution`, `radiationSensitivity`, `anomalousScatterer`, `preferredBeamSizeX`, `preferredBeamSizeY`, `preferredBeamDiameter`, `comments`, `DIFFRACTIONPLANUUID`, `aimedCompleteness`, `aimedIOverSigmaAtHighestRes`, `aimedMultiplicity`, `aimedResolution`, `anomalousData`, `complexity`, `estimateRadiationDamage`, `forcedSpaceGroup`, `requiredCompleteness`, `requiredMultiplicity`, `requiredResolution`, `strategyOption`, `kappaStrategyOption`, `numberOfPositions`, `minDimAccrossSpindleAxis`, `maxDimAccrossSpindleAxis`, `radiationSensitivityBeta`, `radiationSensitivityGamma`, `minOscWidth`, `recordTimeStamp`, `monochromator`, `energy`, `transmission`, `boxSizeX`, `boxSizeY`, `kappaStart`, `axisStart`, `axisRange`, `numberOfImages`, `presetForProposalId`, `beamLineName`, `detectorId`, `distance`, `orientation`, `monoBandwidth`, `centringMethod`, `userPath`, `robotPlateTemperature`, `exposureTemperature`, `experimentTypeId`, `purificationColumnId`, `collectionMode`, `priority`, `qMin`, `qMax`, `reductionParametersAveraging`, `scanParameters`) VALUES (197784,NULL,'OSC',NULL,NULL,0.2,NULL,NULL,NULL,NULL,NULL,10.5,10.5,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,0,NULL,NULL,NULL,1.1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2016-03-20 23:50:27',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +(197788,NULL,NULL,NULL,NULL,10,NULL,NULL,NULL,NULL,NULL,160,100,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2016-10-26 15:28:12',NULL,150,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,4,162.5,45,330.6,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +(197792,'XPDF-1',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2017-03-22 10:56:32',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); /*!40000 ALTER TABLE `DiffractionPlan` ENABLE KEYS */; /*!40000 ALTER TABLE `EMMicroscope` DISABLE KEYS */; @@ -531,7 +534,7 @@ INSERT INTO `EnergyScan` (`energyScanId`, `sessionId`, `blSampleId`, `fluorescen /*!40000 ALTER TABLE `GridImageMap` ENABLE KEYS */; /*!40000 ALTER TABLE `GridInfo` DISABLE KEYS */; -INSERT INTO `GridInfo` (`gridInfoId`, `xOffset`, `yOffset`, `dx_mm`, `dy_mm`, `steps_x`, `steps_y`, `meshAngle`, `recordTimeStamp`, `workflowMeshId`, `orientation`, `dataCollectionGroupId`, `pixelsPerMicronX`, `pixelsPerMicronY`, `snapshot_offsetXPixel`, `snapshot_offsetYPixel`, `snaked`, `dataCollectionId`) VALUES (1281212,NULL,NULL,0.02,0.02,30,16,NULL,'2021-02-25 10:15:06',NULL,'horizontal',5440739,0.83,0.83,304,229.75,1,6017405); +INSERT INTO `GridInfo` (`gridInfoId`, `xOffset`, `yOffset`, `dx_mm`, `dy_mm`, `steps_x`, `steps_y`, `meshAngle`, `recordTimeStamp`, `workflowMeshId`, `orientation`, `dataCollectionGroupId`, `pixelsPerMicronX`, `pixelsPerMicronY`, `snapshot_offsetXPixel`, `snapshot_offsetYPixel`, `snaked`, `dataCollectionId`, `patchesX`, `patchesY`) VALUES (1281212,NULL,NULL,0.02,0.02,30,16,NULL,'2021-02-25 10:15:06',NULL,'horizontal',5440739,0.83,0.83,304,229.75,1,6017405,1,1); /*!40000 ALTER TABLE `GridInfo` ENABLE KEYS */; /*!40000 ALTER TABLE `Image` DISABLE KEYS */; @@ -1046,6 +1049,12 @@ INSERT INTO `ShippingHasSession` (`shippingId`, `sessionId`) VALUES (474,339525) /*!40000 ALTER TABLE `SubtractionToAbInitioModel` DISABLE KEYS */; /*!40000 ALTER TABLE `SubtractionToAbInitioModel` ENABLE KEYS */; +/*!40000 ALTER TABLE `TiltImageAlignment` DISABLE KEYS */; +/*!40000 ALTER TABLE `TiltImageAlignment` ENABLE KEYS */; + +/*!40000 ALTER TABLE `Tomogram` DISABLE KEYS */; +/*!40000 ALTER TABLE `Tomogram` ENABLE KEYS */; + /*!40000 ALTER TABLE `UserGroup_has_Person` DISABLE KEYS */; /*!40000 ALTER TABLE `UserGroup_has_Person` ENABLE KEYS */; diff --git a/schemas/ispyb/lookups.sql b/schemas/ispyb/lookups.sql index 7e3e8c84..eb5d036c 100644 --- a/schemas/ispyb/lookups.sql +++ b/schemas/ispyb/lookups.sql @@ -197,7 +197,10 @@ INSERT INTO `SchemaStatus` (`schemaStatusId`, `scriptName`, `schemaStatus`, `rec (222,'2022_06_22_AdminVar_bump_version.sql','DONE','2022-06-22 12:09:07'), (223,'2022_06_22_cryo-ET_tables.sql','DONE','2022-06-22 12:09:07'), (224,'2022_07_17_BLSubSample_update_blSampleImageId.sql','DONE','2022-08-08 12:03:49'), -(225,'2022_08_08_AdminVar_bump_version.sql','DONE','2022-08-08 16:40:14'); +(225,'2022_08_08_AdminVar_bump_version.sql','DONE','2022-08-08 16:40:14'), +(226,'2022_06_28_diffractionplan_scanparameters.sql','DONE','2022-08-22 11:57:56'), +(227,'2022_06_28_gridinfo_patches.sql','DONE','2022-08-22 11:57:56'), +(228,'2022_06_28_sampleimage_positioner.sql','DONE','2022-08-22 11:57:56'); /*!40000 ALTER TABLE `SchemaStatus` ENABLE KEYS */; /*!40000 ALTER TABLE `ComponentType` DISABLE KEYS */; diff --git a/schemas/ispyb/tables.sql b/schemas/ispyb/tables.sql index 617b2360..ce8d12a9 100644 --- a/schemas/ispyb/tables.sql +++ b/schemas/ispyb/tables.sql @@ -629,6 +629,21 @@ CREATE TABLE `BLSampleImage_has_AutoScoreClass` ( CONSTRAINT `BLSampleImage_has_AutoScoreClass_fk2` FOREIGN KEY (`blSampleImageAutoScoreClassId`) REFERENCES `BLSampleImageAutoScoreClass` (`blSampleImageAutoScoreClassId`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='Many-to-many relationship between drop images and thing being scored, as well as the actual probability (score) that the drop image contains that thing'; /*!40101 SET character_set_client = @saved_cs_client */; +DROP TABLE IF EXISTS `BLSampleImage_has_Positioner`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `BLSampleImage_has_Positioner` ( + `blSampleImageHasPositionerId` int(10) unsigned NOT NULL AUTO_INCREMENT, + `blSampleImageId` int(10) unsigned NOT NULL, + `positionerId` int(10) unsigned NOT NULL, + `value` float DEFAULT NULL COMMENT 'The position of this positioner for this blsampleimage', + PRIMARY KEY (`blSampleImageHasPositionerId`), + KEY `BLSampleImageHasPositioner_ibfk1` (`blSampleImageId`), + KEY `BLSampleImageHasPositioner_ibfk2` (`positionerId`), + CONSTRAINT `BLSampleImageHasPositioner_ibfk1` FOREIGN KEY (`blSampleImageId`) REFERENCES `BLSampleImage` (`blSampleImageId`), + CONSTRAINT `BLSampleImageHasPositioner_ibfk2` FOREIGN KEY (`positionerId`) REFERENCES `Positioner` (`positionerId`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Allows a BLSampleImage to store motor positions along with the image'; +/*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `BLSampleType`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; @@ -1816,6 +1831,7 @@ CREATE TABLE `DiffractionPlan` ( `qMin` float DEFAULT NULL COMMENT 'minimum in qRange, unit: nm^-1, needed for SAXS', `qMax` float DEFAULT NULL COMMENT 'maximum in qRange, unit: nm^-1, needed for SAXS', `reductionParametersAveraging` enum('All','Fastest Dimension','1D') DEFAULT NULL COMMENT 'Post processing params for SAXS', + `scanParameters` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'JSON serialised scan parameters, useful for parameters without designated columns' CHECK (json_valid(`scanParameters`)), PRIMARY KEY (`diffractionPlanId`), KEY `DiffractionPlan_ibfk1` (`presetForProposalId`), KEY `DataCollectionPlan_ibfk3` (`detectorId`), @@ -2031,6 +2047,8 @@ CREATE TABLE `GridInfo` ( `snapshot_offsetYPixel` float DEFAULT NULL, `snaked` tinyint(1) DEFAULT 0 COMMENT 'True: The images associated with the DCG were collected in a snaked pattern', `dataCollectionId` int(11) unsigned DEFAULT NULL, + `patchesX` int(10) DEFAULT 1 COMMENT 'Number of patches the grid is made up of in the X direction', + `patchesY` int(10) DEFAULT 1 COMMENT 'Number of patches the grid is made up of in the Y direction', PRIMARY KEY (`gridInfoId`), KEY `workflowMeshId` (`workflowMeshId`), KEY `GridInfo_ibfk_2` (`dataCollectionGroupId`),