Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions schemas/ispyb/updates/2021_11_09_Positioner_changes.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
INSERT IGNORE INTO SchemaStatus (scriptName, schemaStatus) VALUES ('2021_11_09_Positioner_changes.sql', 'ONGOING');

ALTER TABLE Positioner
ADD beamlineName varchar(10) COMMENT 'The beamline this motor is on';

-- Write your own statement to populate beamlineName for existing positioners:
-- UPDATE Positioner SET beamlineName = ...

ALTER TABLE BLSample_has_Positioner
ADD `value` float COMMENT 'The position of this positioner for this blsample',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not null?

ADD recordTimeStamp datetime COMMENT 'Time that this position was added';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

default now maybe?


UPDATE BLSample_has_Positioner bhp
SET bhp.`value` = (SELECT `value` FROM Positioner WHERE positionerId = bhp.positionerId);

ALTER TABLE Positioner
DROP `value`;

UPDATE SchemaStatus SET schemaStatus = 'DONE' WHERE scriptName = '2021_11_09_Positioner_changes.sql';