From 7e1090d37db32e83c8b76c7ea210a71c190a7669 Mon Sep 17 00:00:00 2001 From: Guilherme de Freitas Date: Thu, 23 Apr 2026 13:53:27 +0100 Subject: [PATCH] Add foreign key to autoProcProgramId in AutoProc --- .../updates/2026_04_24_AutoProc_autoProcProgramId.sql | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 schemas/ispyb/updates/2026_04_24_AutoProc_autoProcProgramId.sql diff --git a/schemas/ispyb/updates/2026_04_24_AutoProc_autoProcProgramId.sql b/schemas/ispyb/updates/2026_04_24_AutoProc_autoProcProgramId.sql new file mode 100644 index 0000000..2762ab8 --- /dev/null +++ b/schemas/ispyb/updates/2026_04_24_AutoProc_autoProcProgramId.sql @@ -0,0 +1,8 @@ +INSERT IGNORE INTO SchemaStatus (scriptName, schemaStatus) VALUES ('2026_04_24_AutoProc_autoProcProgramId.sql', 'ONGOING'); + +ALTER TABLE AutoProc +ADD CONSTRAINT AutoProc_fk_autoProcProgramId +FOREIGN KEY (autoProcProgramId) + REFERENCES AutoProc (autoProcProgramId); + +UPDATE SchemaStatus SET schemaStatus = 'DONE' WHERE scriptName = '2026_04_24_AutoProc_autoProcProgramId.sql';