Skip to content

Commit

Permalink
Use foreign_key_checks=OFF, alter_algorithm='NOCOPY' for a less disru…
Browse files Browse the repository at this point in the history
…ptive ALTER TABLE
  • Loading branch information
KarlLevik committed Jan 25, 2024
1 parent f72bbff commit e755695
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion schemas/ispyb/updates/2024_01_22_cryoEM_tracking.sql
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,14 @@ CREATE TABLE FoilHole (
ON UPDATE CASCADE ON DELETE RESTRICT
) COMMENT 'Details of a Cryo-EM foil hole within a grid square including image captured at foil hole magnification if applicable';

SET SESSION foreign_key_checks=OFF;
SET SESSION alter_algorithm='NOCOPY';

ALTER TABLE Movie
ADD foilHoleId int(11) unsigned,
ADD templateLabel int unsigned,
ADD templateLabel int unsigned;

ALTER TABLE Movie
ADD CONSTRAINT Movie_fk_foilHoleId
FOREIGN KEY (foilHoleId)
REFERENCES FoilHole (foilHoleId)
Expand Down

0 comments on commit e755695

Please sign in to comment.