Skip to content

Commit

Permalink
More fixes to the SQL it references #190
Browse files Browse the repository at this point in the history
  • Loading branch information
antolinos committed Nov 23, 2017
1 parent fdae96b commit f9191fc
Showing 1 changed file with 57 additions and 2 deletions.
59 changes: 57 additions & 2 deletions ispyb-ejb/db/scripts/ahead/20171022_EM.sql
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,6 @@ ADD CONSTRAINT `fk_CTF_1`
ALTER TABLE `pydb`.`CTF`
CHANGE COLUMN `CTFid` `CTFid` INT(11) NOT NULL AUTO_INCREMENT ;

#ALTER TABLE `pydb`.`DataCollectionGroup`
#CHANGE COLUMN `experimentType` `experimentType` ENUM('EM', 'SAD','SAD - Inverse Beam','OSC','Collect - Multiwedge','MAD','Helical','Multi-positional','Mesh','Burn','MAD - Inverse Beam','Characterization','Dehydration') NULL DEFAULT NULL COMMENT 'Experiment type flag' ;

#ALTER TABLE `pydb`.`Movie`
#CHANGE COLUMN `createdTimeStamp` `createdTimeStamp` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ;
Expand All @@ -100,4 +98,61 @@ CHANGE COLUMN `logFileFullPath` `logFileFullPath` VARCHAR(512) NULL DEFAULT NULL
ALTER TABLE `pydb`.`BeamLineSetup`
ADD COLUMN `CS` FLOAT NULL AFTER `minTransmission`;

ALTER TABLE `pydb`.`DataCollectionGroup`
CHANGE COLUMN `experimentType` `experimentType` ENUM('EM', 'SAD','SAD - Inverse Beam','OSC','Collect - Multiwedge','MAD','Helical','Multi-positional','Mesh','Burn','MAD - Inverse Beam','Characterization','Dehydration') NULL DEFAULT NULL COMMENT 'Experiment type flag' ;


CREATE
ALGORITHM = MERGE
DEFINER = `pxadmin`@`%`
SQL SECURITY DEFINER
VIEW `pydb`.`v_em_movie` AS
SELECT
`pydb`.`Movie`.`movieId` AS `Movie_movieId`,
`pydb`.`Movie`.`dataCollectionId` AS `Movie_dataCollectionId`,
`pydb`.`Movie`.`movieNumber` AS `Movie_movieNumber`,
`pydb`.`Movie`.`movieFullPath` AS `Movie_movieFullPath`,
`pydb`.`Movie`.`positionX` AS `Movie_positionX`,
`pydb`.`Movie`.`positionY` AS `Movie_positionY`,
`pydb`.`Movie`.`micrographFullPath` AS `Movie_micrographFullPath`,
`pydb`.`Movie`.`micrographSnapshotFullPath` AS `Movie_micrographSnapshotFullPath`,
`pydb`.`Movie`.`xmlMetaDataFullPath` AS `Movie_xmlMetaDataFullPath`,
`pydb`.`Movie`.`dosePerImage` AS `Movie_dosePerImage`,
`pydb`.`Movie`.`createdTimeStamp` AS `Movie_createdTimeStamp`,
`pydb`.`MotionCorrection`.`motionCorrectionId` AS `MotionCorrection_motionCorrectionId`,
`pydb`.`MotionCorrection`.`movieId` AS `MotionCorrection_movieId`,
`pydb`.`MotionCorrection`.`firstFrame` AS `MotionCorrection_firstFrame`,
`pydb`.`MotionCorrection`.`lastFrame` AS `MotionCorrection_lastFrame`,
`pydb`.`MotionCorrection`.`dosePerFrame` AS `MotionCorrection_dosePerFrame`,
`pydb`.`MotionCorrection`.`doseWeight` AS `MotionCorrection_doseWeight`,
`pydb`.`MotionCorrection`.`totalMotion` AS `MotionCorrection_totalMotion`,
`pydb`.`MotionCorrection`.`averageMotionPerFrame` AS `MotionCorrection_averageMotionPerFrame`,
`pydb`.`MotionCorrection`.`driftPlotFullPath` AS `MotionCorrection_driftPlotFullPath`,
`pydb`.`MotionCorrection`.`micrographFullPath` AS `MotionCorrection_micrographFullPath`,
`pydb`.`MotionCorrection`.`micrographSnapshotFullPath` AS `MotionCorrection_micrographSnapshotFullPath`,
`pydb`.`MotionCorrection`.`correctedDoseMicrographFullPath` AS `MotionCorrection_correctedDoseMicrographFullPath`,
`pydb`.`MotionCorrection`.`patchesUsed` AS `MotionCorrection_patchesUsed`,
`pydb`.`MotionCorrection`.`logFileFullPath` AS `MotionCorrection_logFileFullPath`,
`pydb`.`CTF`.`CTFid` AS `CTF_CTFid`,
`pydb`.`CTF`.`motionCorrectionId` AS `CTF_motionCorrectionId`,
`pydb`.`CTF`.`spectraImageThumbnailFullPath` AS `CTF_spectraImageThumbnailFullPath`,
`pydb`.`CTF`.`spectraImageFullPath` AS `CTF_spectraImageFullPath`,
`pydb`.`CTF`.`defocusU` AS `CTF_defocusU`,
`pydb`.`CTF`.`defocusV` AS `CTF_defocusV`,
`pydb`.`CTF`.`angle` AS `CTF_angle`,
`pydb`.`CTF`.`crossCorrelationCoefficient` AS `CTF_crossCorrelationCoefficient`,
`pydb`.`CTF`.`resolutionLimit` AS `CTF_resolutionLimit`,
`pydb`.`CTF`.`estimatedBfactor` AS `CTF_estimatedBfactor`,
`pydb`.`CTF`.`logFilePath` AS `CTF_logFilePath`,
`pydb`.`CTF`.`createdTimeStamp` AS `CTF_createdTimeStamp`,
`pydb`.`Proposal`.`proposalId` AS `Proposal_proposalId`,
`pydb`.`BLSession`.`sessionId` AS `BLSession_sessionId`
FROM
((((((`pydb`.`Movie`
LEFT JOIN `pydb`.`MotionCorrection` ON ((`pydb`.`MotionCorrection`.`movieId` = `pydb`.`Movie`.`movieId`)))
LEFT JOIN `pydb`.`DataCollection` ON ((`pydb`.`DataCollection`.`dataCollectionId` = `pydb`.`Movie`.`dataCollectionId`)))
LEFT JOIN `pydb`.`DataCollectionGroup` ON ((`pydb`.`DataCollectionGroup`.`dataCollectionGroupId` = `pydb`.`DataCollection`.`dataCollectionGroupId`)))
LEFT JOIN `pydb`.`BLSession` ON ((`pydb`.`BLSession`.`sessionId` = `pydb`.`DataCollectionGroup`.`sessionId`)))
LEFT JOIN `pydb`.`Proposal` ON ((`pydb`.`Proposal`.`proposalId` = `pydb`.`BLSession`.`proposalId`)))
LEFT JOIN `pydb`.`CTF` ON ((`pydb`.`CTF`.`motionCorrectionId` = `pydb`.`MotionCorrection`.`motionCorrectionId`)));
update `pydb`.SchemaStatus set schemaStatus = 'DONE' where scriptName = '20171022_EM.sql';

0 comments on commit f9191fc

Please sign in to comment.