From db265a80a3d0a30441d40129b16ad6caf80a6a92 Mon Sep 17 00:00:00 2001 From: Karl Levik Date: Fri, 30 Aug 2019 13:01:38 +0100 Subject: [PATCH] Fix SP upsert_sleeve + bump version + update doc --- docs/list_of_procs.rst | 2 +- schema/lookups.sql | 6 +++--- schema/routines.sql | 4 ++-- schema/stored_programs/sp_upsert_sleeve.sql | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/list_of_procs.rst b/docs/list_of_procs.rst index e77fcce6..34b8ea7c 100644 --- a/docs/list_of_procs.rst +++ b/docs/list_of_procs.rst @@ -135,7 +135,7 @@ "**upsert_sample_image_analysis**","INOUT p_id int(11) unsigned, p_containerBarcode varchar(45), p_sampleLocation varchar(45), p_oavSnapshotBefore varchar(255), p_oavSnapshotAfter varchar(255), p_deltaX int, p_deltaY int, p_goodnessOfFit float, p_scaleFactor float, p_resultCode varchar(15), p_matchStartTS timestamp, p_matchEndTS timestamp","Insert or update info about the sample image analysis for the mo" "**upsert_session_for_proposal_code_number**","INOUT p_id int(11) unsigned, p_proposalCode varchar(3), p_proposalNumber int(11), p_visitNumber int(10) unsigned, p_beamLineSetupId int(10) unsigned, p_startDate datetime, p_endDate datetime, p_beamlineName varchar(45), p_title varchar(255), p_beamlineOperator varchar(45), p_nbShifts int(10) unsigned, p_scheduled tinyint(1), p_usedFlag tinyint(1), p_comments varchar(255), p_externalPkId int(11) unsigned, p_externalPkUUID varchar(32)","Inserts or updates a session for a proposal with given code and" "**upsert_session_has_person**","p_sessionId int(10) unsigned, p_personId int(10) unsigned, p_role varchar(100), p_remote tinyint(1)","Inserts or updates info about a session - person association (p_sessionId, p_personId).Mandatory columns:For insert: p_sessionId, p_personIdFor update: p_sessionId, p_personIdReturns: Nothing." - "**upsert_sleeve**","p_id tinyint unsigned, p_location tinyint unsigned, p_lastMovedToFreezer datetime, p_lastMovedFromFreezer datetime","" + "**upsert_sleeve**","INOUT p_id tinyint unsigned, p_location tinyint unsigned, p_lastMovedToFreezer datetime, p_lastMovedFromFreezer datetime","" "**upsert_xfe_fluo_spectrum**","INOUT p_id int(11) unsigned, p_sessionId int(10) unsigned, p_sampleId int(10) unsigned, p_subSampleId int(11) unsigned, p_startTime datetime, p_endTime datetime, p_energy float, p_fileName varchar(255), p_annotatedPymcaSpectrum varchar(255), p_fittedDataFileFullPath varchar(255), p_jpegScanFileFullPath varchar(255), p_scanFileFullPath varchar(255), p_beamSizeHorizontal float, p_beamSizeVertical float, p_exposureTime float, p_transmission float, p_flux double, p_fluxEnd double, p_comments varchar(1024)","Inserts or updates info about a fluorescence spectrum measuremen" "**upsert_xray_centring_result**","INOUT p_id int(11) unsigned, p_gridInfoId int(11) unsigned, p_method varchar(15), p_status varchar(45), p_x float, p_y float","Inserts or updates info about an x-ray centring result (p_id).Mandatory columns:For insert: p_gridInfoId and p_statusFor update: p_id Returns: Record ID in p_id." "**Warnings**","","" diff --git a/schema/lookups.sql b/schema/lookups.sql index c6f518b8..ac9f1be7 100644 --- a/schema/lookups.sql +++ b/schema/lookups.sql @@ -19,7 +19,7 @@ -- /*!40000 ALTER TABLE `AdminVar` DISABLE KEYS */; -INSERT INTO `AdminVar` (`varId`, `name`, `value`) VALUES (4,'schemaVersion','1.6.1'); +INSERT INTO `AdminVar` (`varId`, `name`, `value`) VALUES (4,'schemaVersion','1.6.2'); /*!40000 ALTER TABLE `AdminVar` ENABLE KEYS */; -- @@ -27,7 +27,7 @@ INSERT INTO `AdminVar` (`varId`, `name`, `value`) VALUES (4,'schemaVersion','1.6 -- /*!40000 ALTER TABLE `SchemaStatus` DISABLE KEYS */; -INSERT INTO `SchemaStatus` (`schemaStatusId`, `scriptName`, `schemaStatus`, `recordTimeStamp`) VALUES (6,'20180213_BLSample_subLocation.sql','DONE','2018-02-13 13:27:19'),(12,'20180213_DataCollectionFileAttachment_fileType.sql','DONE','2018-02-13 15:12:54'),(16,'20180303_v_run_to_table.sql','DONE','2018-07-25 15:11:18'),(19,'20180328_ImageQualityIndicators_alter_table.sql','DONE','2018-07-25 15:11:18'),(22,'20180410_BeamLineSetup_alter.sql','DONE','2018-07-25 15:11:18'),(25,'20180413_BeamLineSetup_and_Detector_alter.sql','DONE','2018-07-25 15:11:18'),(28,'20180501_DataCollectionGroup_experimentType_enum.sql','DONE','2018-07-25 15:11:18'),(31,'20180531_ScreeningOutput_alignmentSuccess.sql','DONE','2018-07-25 15:11:18'),(34,'20180629_DataCollection_imageContainerSubPath.sql','DONE','2018-07-25 15:11:18'),(35,'20180913_BeamCalendar.sql','DONE','2018-09-19 09:52:45'),(36,'2018_09_19_DataCollection_imageDirectory_comment.sql','DONE','2018-09-19 12:38:01'),(37,'2018_09_27_increase_schema_version.sql','DONE','2018-09-27 13:17:15'),(38,'2018_11_01_XrayCenteringResult.sql','DONE','2018-11-01 13:36:53'),(39,'2018_11_01_AutoProcProgram_dataCollectionId.sql','DONE','2018-11-01 15:10:38'),(40,'2018_11_01_AutoProcProgramMessage.sql','DONE','2018-11-01 15:28:17'),(44,'2018_11_01_DiffractionPlan_centeringMethod.sql','DONE','2018-11-01 22:51:36'),(45,'2018_11_02_DataCollectionGroup_experimentType_enum.sql','DONE','2018-11-02 11:54:15'),(47,'2018_11_05_spelling_of_centring.sql','DONE','2018-11-05 15:31:38'),(48,'2018_11_09_AutoProcProgram_update_processing_program.sql','DONE','2018-11-09 16:38:34'),(49,'2018_11_14_AutoProcProgramMessage_autoinc.sql','DONE','2018-11-14 10:15:27'),(50,'2018_11_22_AutoProcProgram_processingStatus_update.sql','DONE','2018-11-22 16:11:15'),(51,'2018_12_04_EnergyScan_and_XFEFluorescenceSpectrum_add_axisPosition.sql','DONE','2018-12-04 14:13:23'),(52,'2018_12_20_DataCollectionGroup_scanParameters.sql','DONE','2018-12-20 17:30:04'),(53,'2019_01_14_Proposal_state.sql','DONE','2019-01-14 12:13:31'),(54,'2019_01_14_ProcessingJobParameter_parameterValue.sql','DONE','2019-01-14 14:00:02'),(57,'2019_01_15_Detector_localName.sql','DONE','2019-01-15 23:01:15'),(58,'2019_02_04_BLSession_unique_index.sql','DONE','2019-02-04 13:52:19'),(59,'2019_03_29_BLSession_archived.sql','DONE','2019-04-03 14:43:08'),(60,'2019_04_03_UserGroup_and_Permission.sql','DONE','2019-04-03 14:51:04'),(61,'2019_04_07_AdminVar_bump_version.sql','DONE','2019-04-07 11:35:06'),(62,'2019_04_08_AdminVar_bump_version.sql','DONE','2019-04-08 15:38:01'),(63,'2019_04_23_AdminVar_bump_version.sql','DONE','2019-04-23 11:13:27'),(64,'2019_04_23_drop_v_run_view.sql','DONE','2019-04-23 11:13:35'),(67,'2019_04_23_v_run_additional_runs.sql','DONE','2019-04-23 12:39:47'),(68,'2019_05_28_AdminVar_bump_version.sql','DONE','2019-05-28 13:29:27'),(72,'2019_07_17_BLSample_crystalId_default.sql','DONE','2019-07-17 15:21:59'),(73,'2019_08_15_Sleeve.sql','DONE','2019-08-15 08:34:34'),(74,'2019_08_15_AdminVar_bump_version.sql','DONE','2019-08-15 08:57:37'),(75,'2019_08_28_AdminVar_bump_version.sql','DONE','2019-08-28 13:30:13'); +INSERT INTO `SchemaStatus` (`schemaStatusId`, `scriptName`, `schemaStatus`, `recordTimeStamp`) VALUES (6,'20180213_BLSample_subLocation.sql','DONE','2018-02-13 13:27:19'),(12,'20180213_DataCollectionFileAttachment_fileType.sql','DONE','2018-02-13 15:12:54'),(16,'20180303_v_run_to_table.sql','DONE','2018-07-25 15:11:18'),(19,'20180328_ImageQualityIndicators_alter_table.sql','DONE','2018-07-25 15:11:18'),(22,'20180410_BeamLineSetup_alter.sql','DONE','2018-07-25 15:11:18'),(25,'20180413_BeamLineSetup_and_Detector_alter.sql','DONE','2018-07-25 15:11:18'),(28,'20180501_DataCollectionGroup_experimentType_enum.sql','DONE','2018-07-25 15:11:18'),(31,'20180531_ScreeningOutput_alignmentSuccess.sql','DONE','2018-07-25 15:11:18'),(34,'20180629_DataCollection_imageContainerSubPath.sql','DONE','2018-07-25 15:11:18'),(35,'20180913_BeamCalendar.sql','DONE','2018-09-19 09:52:45'),(36,'2018_09_19_DataCollection_imageDirectory_comment.sql','DONE','2018-09-19 12:38:01'),(37,'2018_09_27_increase_schema_version.sql','DONE','2018-09-27 13:17:15'),(38,'2018_11_01_XrayCenteringResult.sql','DONE','2018-11-01 13:36:53'),(39,'2018_11_01_AutoProcProgram_dataCollectionId.sql','DONE','2018-11-01 15:10:38'),(40,'2018_11_01_AutoProcProgramMessage.sql','DONE','2018-11-01 15:28:17'),(44,'2018_11_01_DiffractionPlan_centeringMethod.sql','DONE','2018-11-01 22:51:36'),(45,'2018_11_02_DataCollectionGroup_experimentType_enum.sql','DONE','2018-11-02 11:54:15'),(47,'2018_11_05_spelling_of_centring.sql','DONE','2018-11-05 15:31:38'),(48,'2018_11_09_AutoProcProgram_update_processing_program.sql','DONE','2018-11-09 16:38:34'),(49,'2018_11_14_AutoProcProgramMessage_autoinc.sql','DONE','2018-11-14 10:15:27'),(50,'2018_11_22_AutoProcProgram_processingStatus_update.sql','DONE','2018-11-22 16:11:15'),(51,'2018_12_04_EnergyScan_and_XFEFluorescenceSpectrum_add_axisPosition.sql','DONE','2018-12-04 14:13:23'),(52,'2018_12_20_DataCollectionGroup_scanParameters.sql','DONE','2018-12-20 17:30:04'),(53,'2019_01_14_Proposal_state.sql','DONE','2019-01-14 12:13:31'),(54,'2019_01_14_ProcessingJobParameter_parameterValue.sql','DONE','2019-01-14 14:00:02'),(57,'2019_01_15_Detector_localName.sql','DONE','2019-01-15 23:01:15'),(58,'2019_02_04_BLSession_unique_index.sql','DONE','2019-02-04 13:52:19'),(59,'2019_03_29_BLSession_archived.sql','DONE','2019-04-03 14:43:08'),(60,'2019_04_03_UserGroup_and_Permission.sql','DONE','2019-04-03 14:51:04'),(61,'2019_04_07_AdminVar_bump_version.sql','DONE','2019-04-07 11:35:06'),(62,'2019_04_08_AdminVar_bump_version.sql','DONE','2019-04-08 15:38:01'),(63,'2019_04_23_AdminVar_bump_version.sql','DONE','2019-04-23 11:13:27'),(64,'2019_04_23_drop_v_run_view.sql','DONE','2019-04-23 11:13:35'),(67,'2019_04_23_v_run_additional_runs.sql','DONE','2019-04-23 12:39:47'),(68,'2019_05_28_AdminVar_bump_version.sql','DONE','2019-05-28 13:29:27'),(72,'2019_07_17_BLSample_crystalId_default.sql','DONE','2019-07-17 15:21:59'),(73,'2019_08_15_Sleeve.sql','DONE','2019-08-15 08:34:34'),(74,'2019_08_15_AdminVar_bump_version.sql','DONE','2019-08-15 08:57:37'),(75,'2019_08_28_AdminVar_bump_version.sql','DONE','2019-08-28 13:30:13'),(76,'2019_08_30_AdminVar_bump_version.sql','DONE','2019-08-30 11:58:16'); /*!40000 ALTER TABLE `SchemaStatus` ENABLE KEYS */; -- @@ -159,4 +159,4 @@ INSERT INTO `Permission` (`permissionId`, `type`, `description`) VALUES (1,'mx_a /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2019-08-28 14:30:35 +-- Dump completed on 2019-08-30 12:58:29 diff --git a/schema/routines.sql b/schema/routines.sql index 4bd2f012..311774a6 100644 --- a/schema/routines.sql +++ b/schema/routines.sql @@ -7341,7 +7341,7 @@ DELIMITER ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET sql_mode = 'STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; -CREATE PROCEDURE `upsert_sleeve`(p_id tinyint unsigned, p_location tinyint unsigned, p_lastMovedToFreezer datetime, p_lastMovedFromFreezer datetime) +CREATE PROCEDURE `upsert_sleeve`(INOUT p_id tinyint unsigned, p_location tinyint unsigned, p_lastMovedToFreezer datetime, p_lastMovedFromFreezer datetime) BEGIN IF NOT (p_id IS NULL) THEN INSERT INTO Sleeve (sleeveId, location, lastMovedToFreezer, lastMovedFromFreezer) VALUES (p_id, p_location, p_lastMovedToFreezer, p_lastMovedFromFreezer) @@ -7507,4 +7507,4 @@ DELIMITER ; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2019-08-28 14:25:31 +-- Dump completed on 2019-08-28 16:06:59 diff --git a/schema/stored_programs/sp_upsert_sleeve.sql b/schema/stored_programs/sp_upsert_sleeve.sql index 1ef7ba2a..9ea70ea6 100644 --- a/schema/stored_programs/sp_upsert_sleeve.sql +++ b/schema/stored_programs/sp_upsert_sleeve.sql @@ -1,6 +1,6 @@ DELIMITER ;; -CREATE OR REPLACE PROCEDURE upsert_sleeve(p_id tinyint unsigned, p_location tinyint unsigned, p_lastMovedToFreezer datetime, p_lastMovedFromFreezer datetime) +CREATE OR REPLACE PROCEDURE upsert_sleeve(INOUT p_id tinyint unsigned, p_location tinyint unsigned, p_lastMovedToFreezer datetime, p_lastMovedFromFreezer datetime) BEGIN IF NOT (p_id IS NULL) THEN INSERT INTO Sleeve (sleeveId, location, lastMovedToFreezer, lastMovedFromFreezer) VALUES (p_id, p_location, p_lastMovedToFreezer, p_lastMovedFromFreezer)