diff --git a/HISTORY.rst b/HISTORY.rst index 904cb07..df9f3a7 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -5,6 +5,27 @@ History Unreleased / master ------------------- +4.6.0 (2025-03-06) +------------------- + +New columns: + +- Add a ``dewarRegistryId`` FK to the ``Dewar`` table + +Data in lookup tables: + +- Add 'Atlas' experiment type + +Stored procedures: + +- Remove superfluous commit in procedure ``upsert_processing_program`` +- New procedure ``upsert_processing_program_v2`` with additional param for pipeline ID + +Permissions: + +- Add ``SELECT`` grant for Expeye role on table ``AutoProcIntegration`` +- Add ``EXECUTE`` grant for processing role on new procedure ``upsert_processing_program_v2`` + 4.5.0 (2025-02-25) ------------------- diff --git a/schemas/ispyb/lookups.sql b/schemas/ispyb/lookups.sql index 37fba1e..c4ed6af 100644 --- a/schemas/ispyb/lookups.sql +++ b/schemas/ispyb/lookups.sql @@ -11,7 +11,7 @@ /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; /*!40000 ALTER TABLE `AdminVar` DISABLE KEYS */; -INSERT INTO `AdminVar` (`varId`, `name`, `value`) VALUES (4,'schemaVersion','4.5.0'); +INSERT INTO `AdminVar` (`varId`, `name`, `value`) VALUES (4,'schemaVersion','4.6.0'); /*!40000 ALTER TABLE `AdminVar` ENABLE KEYS */; /*!40000 ALTER TABLE `SchemaStatus` DISABLE KEYS */; @@ -275,7 +275,10 @@ INSERT INTO `SchemaStatus` (`schemaStatusId`, `scriptName`, `schemaStatus`, `rec (303,'2025_01_24_Tomogram_gridSquare.sql','DONE','2025-01-29 10:29:27'), (304,'2025_01_29_AdminVar_bump_version.sql','DONE','2025-01-29 10:29:27'), (305,'2025_02_14_BLSession_purgedProcessedData.sql','DONE','2025-02-25 15:51:29'), -(306,'2025_02_25_AdminVar_bump_version.sql','DONE','2025-02-25 15:51:30'); +(306,'2025_02_25_AdminVar_bump_version.sql','DONE','2025-02-25 15:51:30'), +(307,'2025_02_27_ExperimentType_atlas.sql','DONE','2025-03-06 11:58:07'), +(308,'2025_03_05_Dewar_dewarRegistryId.sql','DONE','2025-03-06 11:58:07'), +(309,'2025_03_06_AdminVar_bump_version.sql','DONE','2025-03-06 11:58:07'); /*!40000 ALTER TABLE `SchemaStatus` ENABLE KEYS */; /*!40000 ALTER TABLE `ComponentType` DISABLE KEYS */; @@ -392,7 +395,8 @@ INSERT INTO `ExperimentType` (`experimentTypeId`, `name`, `proposalType`, `activ (40,'Still','mx',1), (41,'SSX-Chip','mx',1), (42,'SSX-Jet','mx',1), -(43,'Metal ID','mx',1); +(43,'Metal ID','mx',1), +(44,'Atlas','em',1); /*!40000 ALTER TABLE `ExperimentType` ENABLE KEYS */; /*!40000 ALTER TABLE `InspectionType` DISABLE KEYS */; diff --git a/schemas/ispyb/tables.sql b/schemas/ispyb/tables.sql index 02bb099..e3d5244 100644 --- a/schemas/ispyb/tables.sql +++ b/schemas/ispyb/tables.sql @@ -1614,12 +1614,15 @@ CREATE TABLE `Dewar` ( `extra` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'JSON column for facility-specific or hard-to-define attributes, e.g. LN2 top-ups and contents checks' CHECK (json_valid(`extra`)), `source` varchar(50) DEFAULT current_user(), `externalShippingIdFromSynchrotron` int(11) unsigned DEFAULT NULL COMMENT 'ID for shipping from synchrotron in external application', + `dewarRegistryId` int(11) unsigned DEFAULT NULL COMMENT 'Reference to the registered dewar i.e. the physical item', PRIMARY KEY (`dewarId`), UNIQUE KEY `barCode` (`barCode`), KEY `Dewar_FKIndex1` (`shippingId`), KEY `Dewar_FKIndex2` (`firstExperimentId`), KEY `Dewar_FKIndexCode` (`code`), KEY `Dewar_FKIndexStatus` (`dewarStatus`), + KEY `Dewar_fk_dewarRegistryId` (`dewarRegistryId`), + CONSTRAINT `Dewar_fk_dewarRegistryId` FOREIGN KEY (`dewarRegistryId`) REFERENCES `DewarRegistry` (`dewarRegistryId`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `Dewar_fk_firstExperimentId` FOREIGN KEY (`firstExperimentId`) REFERENCES `BLSession` (`sessionId`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `Dewar_ibfk_1` FOREIGN KEY (`shippingId`) REFERENCES `Shipping` (`shippingId`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=latin1; diff --git a/schemas/ispyb/updates/2025_02_27_ExperimentType_atlas.sql.sql b/schemas/ispyb/updates/2025_02_27_ExperimentType_atlas.sql similarity index 100% rename from schemas/ispyb/updates/2025_02_27_ExperimentType_atlas.sql.sql rename to schemas/ispyb/updates/2025_02_27_ExperimentType_atlas.sql diff --git a/schemas/ispyb/updates/2025_03_06_AdminVar_bump_version.sql b/schemas/ispyb/updates/2025_03_06_AdminVar_bump_version.sql new file mode 100644 index 0000000..eb1af0f --- /dev/null +++ b/schemas/ispyb/updates/2025_03_06_AdminVar_bump_version.sql @@ -0,0 +1,5 @@ +INSERT IGNORE INTO SchemaStatus (scriptName, schemaStatus) VALUES ('2025_03_06_AdminVar_bump_version.sql', 'ONGOING'); + +UPDATE AdminVar SET `value` = '4.6.0' WHERE `name` = 'schemaVersion'; + +UPDATE SchemaStatus SET schemaStatus = 'DONE' WHERE scriptName = '2025_03_06_AdminVar_bump_version.sql';