-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New stored procedure upsert_dc_grid_v2 using params p_micronsPerPixel…
…X,Y (#198) * New sproc upsert_dc_grid_v2 using params p_micronsPerPixelX,Y * Add grant to execute new sproc upsert_dc_grid_v2 * Refresh schema files with new sproc upsert_dc_grid_v2 * Update history with new stored procedure * Bump up version to 2.1.0
- Loading branch information
Showing
6 changed files
with
122 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
-- Example call: | ||
-- SET @id := NULL; | ||
-- CALL upsert_dc_grid_v2(@id, 993677, 1.0, 2.0, 3, 4, 90, 10, 20, 30, 40, 'vertical', TRUE); | ||
|
||
DELIMITER ;; | ||
CREATE OR REPLACE DEFINER=`ispyb_root`@`%` PROCEDURE `upsert_dc_grid_v2`( | ||
INOUT p_id int(11) unsigned, | ||
p_dcId int(11) unsigned, | ||
p_dxInMm double, | ||
p_dyInMm double, | ||
p_stepsX double, | ||
p_stepsY double, | ||
p_meshAngle double, | ||
p_micronsPerPixelX float, | ||
p_micronsPerPixelY float, | ||
p_snapshotOffsetXPixel float, | ||
p_snapshotOffsetYPixel float, | ||
p_orientation enum('vertical','horizontal'), | ||
p_snaked boolean | ||
) | ||
MODIFIES SQL DATA | ||
BEGIN | ||
IF p_dcId IS NOT NULL THEN | ||
INSERT INTO GridInfo (gridInfoId, dataCollectionId, dx_mm, dy_mm, steps_x, steps_y, meshAngle, | ||
micronsPerPixelX, micronsPerPixelY, snapshot_offsetXPixel, snapshot_offsetYPixel, | ||
orientation, snaked) | ||
VALUES (p_id, p_dcId, p_dxInMm, p_dyInMm, p_stepsX, p_stepsY, p_meshAngle, | ||
p_micronsPerPixelX, p_micronsPerPixelY, p_snapshotOffsetXPixel, p_snapshotOffsetYPixel, | ||
p_orientation, p_snaked) | ||
ON DUPLICATE KEY UPDATE | ||
dataCollectionId = IFNULL(p_dcId, dataCollectionId), | ||
dx_mm = IFNULL(p_dxInMm, dx_mm), | ||
dy_mm = IFNULL(p_dyInMm, dy_mm), | ||
steps_x = IFNULL(p_stepsX, steps_x), | ||
steps_y = IFNULL(p_stepsY, steps_y), | ||
meshAngle = IFNULL(p_meshAngle, meshAngle), | ||
micronsPerPixelX = IFNULL(p_micronsPerPixelX, micronsPerPixelX), | ||
micronsPerPixelY = IFNULL(p_micronsPerPixelY, micronsPerPixelY), | ||
snapshot_offsetXPixel = IFNULL(p_snapshotOffsetXPixel, snapshot_offsetXPixel), | ||
snapshot_offsetYPixel = IFNULL(p_snapshotOffsetYPixel, snapshot_offsetYPixel), | ||
orientation = IFNULL(p_orientation, orientation), | ||
snaked = IFNULL(p_snaked, snaked); | ||
IF LAST_INSERT_ID() <> 0 THEN | ||
SET p_id = LAST_INSERT_ID(); | ||
END IF; | ||
END IF; | ||
END ;; | ||
DELIMITER ; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
INSERT IGNORE INTO SchemaStatus (scriptName, schemaStatus) VALUES ('2023_06_05_AdminVar_bump_version.sql', 'ONGOING'); | ||
|
||
UPDATE AdminVar SET `value` = '2.1.0' WHERE `name` = 'schemaVersion'; | ||
|
||
UPDATE SchemaStatus SET schemaStatus = 'DONE' WHERE scriptName = '2023_06_05_AdminVar_bump_version.sql'; |