   ADD FOREIGN KEY(ARRAY_ID)
   REFERENCES ARRAY(ID);
 
+ALTER TABLE INVESTIGATIONSOURCE
+  ADD FOREIGN KEY(INVESTIGATION_ID)
+  REFERENCES INVESTIGATION(ID);
+
+ALTER TABLE INVESTIGATIONSOURCE
+  ADD FOREIGN KEY(SOURCE_ID)
+  REFERENCES BIOMATERIAL(ID);
+
+ALTER TABLE INVESTIGATIONSAMPLE
+  ADD FOREIGN KEY(INVESTIGATION_ID)
+  REFERENCES INVESTIGATION(ID);
+
+ALTER TABLE INVESTIGATIONSAMPLE
+  ADD FOREIGN KEY(SAMPLE_ID)
+  REFERENCES BIOMATERIAL(ID);
+
 ALTER TABLE NORMALIZATIONTYPE
   ADD FOREIGN KEY(INVESTIGATION_ID)
   REFERENCES INVESTIGATION(ID);

DROP TABLE IF EXISTS EXPERIMENT;
DROP TABLE IF EXISTS INVESTIGATIONARRAYDESIGN;
DROP TABLE IF EXISTS INVESTIGATIONARRAY;
DROP TABLE IF EXISTS NORMALIZATIONTYPE;
DROP TABLE IF EXISTS REPLICATETYPE;
DROP TABLE IF EXISTS QUALITYCONTROLTYPE;

  PRIMARY KEY                 (INVESTIGATION_ID, ARRAY_ID)
);

CREATE TABLE INVESTIGATIONSOURCE
(
  INVESTIGATION_ID            BIGINT      NOT NULL,
  SOURCE_ID                   BIGINT      NOT NULL,
  PRIMARY KEY                 (INVESTIGATION_ID, SOURCE_ID)
);

CREATE TABLE INVESTIGATIONSAMPLE
(
  INVESTIGATION_ID            BIGINT      NOT NULL,
  SAMPLE_ID                   BIGINT      NOT NULL,
  PRIMARY KEY                 (INVESTIGATION_ID, SAMPLE_ID)
);

CREATE TABLE NORMALIZATIONTYPE
(
  INVESTIGATION_ID            BIGINT      NOT NULL,
