From 0163d73be96f925ef26c25919e2bf49611ff75f7 Mon Sep 17 00:00:00 2001 From: Guilherme de Freitas Date: Wed, 8 Apr 2026 14:05:58 +0100 Subject: [PATCH] Add Protein_has_Component table --- .../2026_04_08_Protein_has_Component.sql | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 schemas/ispyb/updates/2026_04_08_Protein_has_Component.sql diff --git a/schemas/ispyb/updates/2026_04_08_Protein_has_Component.sql b/schemas/ispyb/updates/2026_04_08_Protein_has_Component.sql new file mode 100644 index 00000000..3c61a97e --- /dev/null +++ b/schemas/ispyb/updates/2026_04_08_Protein_has_Component.sql @@ -0,0 +1,19 @@ +INSERT IGNORE INTO SchemaStatus (scriptName, schemaStatus) VALUES ('2026_04_08_Protein_has_Component.sql', 'ONGOING'); + +CREATE TABLE Protein_has_Component ( + proteinHasComponentId int(11) unsigned PRIMARY KEY AUTO_INCREMENT, + proteinId int(10) unsigned NOT NULL COMMENT 'References Protein table', + componentId int(10) unsigned NOT NULL COMMENT 'References Component table', + CONSTRAINT `Protein_has_Component_fk_proteinId` + FOREIGN KEY (proteinId) + REFERENCES Protein (proteinId) + ON DELETE CASCADE + ON UPDATE CASCADE, + CONSTRAINT `Protein_has_Component_fk_componentId` + FOREIGN KEY (componentId) + REFERENCES Component (componentId) + ON DELETE CASCADE + ON UPDATE CASCADE +) COMMENT = 'Which elements are contained inside a molecule'; + +UPDATE SchemaStatus SET schemaStatus = 'DONE' WHERE scriptName = '2026_04_08_Protein_has_Component.sql';