Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements to the Positioner + BLSample_has_Positioner tables #105

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
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';