ispyb / ispyb-database-modeling

4 stars 3 forks source link

Add diffractionplanid to datacollection and containerqueuesample #52

Open stufisher opened 4 years ago

stufisher commented 4 years ago

I would like to add diffractionplanid to datacollection and containerqueuesample. This will allow us to know which diffraction plan has been queued and which diffractionplan a datacollection came from.

ALTER TABLE `DataCollection` 
    ADD `diffractionPlanId` INT UNSIGNED NULL DEFAULT NULL,
    ADD CONSTRAINT `DataCollection_ibfk9`
        FOREIGN KEY (`diffractionPlanId`)
            REFERENCES `DiffractionPlan`(`diffractionPlanId`)
                ON DELETE NO ACTION ON UPDATE NO ACTION;

ALTER TABLE `ContainerQueueSample` 
    ADD `diffractionPlanId` INT UNSIGNED NULL DEFAULT NULL,
    ADD CONSTRAINT `ContainerQueueSample_ibfk3`
        FOREIGN KEY (`diffractionPlanId`)
            REFERENCES `DiffractionPlan`(`diffractionPlanId`)
                ON DELETE NO ACTION ON UPDATE NO ACTION,
    ADD `blSampleId` INT(10) UNSIGNED NULL DEFAULT NULL,
    ADD CONSTRAINT `ContainerQueueSample_ibfk4`
        FOREIGN KEY (`blSampleId`)
            REFERENCES `BLSample`(`blSampleId`)
                ON DELETE NO ACTION ON UPDATE NO ACTION;
KarlLevik commented 4 years ago
stufisher commented 4 years ago

@KarlLevik note i added blsample to containerqueuesample here so it can be used to queue samples, and subsamples. These are all related to each other so i think this is ok