-- Tables

-- Alters

ALTER TABLE AKUZ.T_PRENATAL_SCREENING DROP COLUMN "trisomy21";

ALTER TABLE AKUZ.T_PRENATAL_SCREENING DROP COLUMN "trisomy18";

ALTER TABLE AKUZ.T_PRENATAL_SCREENING DROP COLUMN "trisomy13";

ALTER TABLE AKUZ.T_PRENATAL_SCREENING DROP COLUMN "preeclampsiarisk";

ALTER TABLE AKUZ.T_PRENATAL_SCREENING DROP COLUMN "fetalgrowthrisk";

ALTER TABLE AKUZ.T_PRENATAL_SCREENING DROP COLUMN "prematurebirthrisk";

ALTER TABLE AKUZ.T_PRENATAL_SCREENING ADD "trisomy21basefirst" integer NULL;

UPDATE AKUZ.T_PRENATAL_SCREENING SET "trisomy21basefirst" = 0;

ALTER TABLE AKUZ.T_PRENATAL_SCREENING ALTER COLUMN "trisomy21basefirst" SET NOT NULL;

ALTER TABLE AKUZ.T_PRENATAL_SCREENING ADD "trisomy18basefirst" integer NULL;

UPDATE AKUZ.T_PRENATAL_SCREENING SET "trisomy18basefirst" = 0;

ALTER TABLE AKUZ.T_PRENATAL_SCREENING ALTER COLUMN "trisomy18basefirst" SET NOT NULL;

ALTER TABLE AKUZ.T_PRENATAL_SCREENING ADD "trisomy13basefirst" integer NULL;

UPDATE AKUZ.T_PRENATAL_SCREENING SET "trisomy13basefirst" = 0;

ALTER TABLE AKUZ.T_PRENATAL_SCREENING ALTER COLUMN "trisomy13basefirst" SET NOT NULL;

ALTER TABLE AKUZ.T_PRENATAL_SCREENING ADD "trisomy21basesecond" integer NULL;

UPDATE AKUZ.T_PRENATAL_SCREENING SET "trisomy21basesecond" = 0;

ALTER TABLE AKUZ.T_PRENATAL_SCREENING ALTER COLUMN "trisomy21basesecond" SET NOT NULL;

ALTER TABLE AKUZ.T_PRENATAL_SCREENING ADD "trisomy18basesecond" integer NULL;

UPDATE AKUZ.T_PRENATAL_SCREENING SET "trisomy18basesecond" = 0;

ALTER TABLE AKUZ.T_PRENATAL_SCREENING ALTER COLUMN "trisomy18basesecond" SET NOT NULL;

ALTER TABLE AKUZ.T_PRENATAL_SCREENING ADD "trisomy13basesecond" integer NULL;

UPDATE AKUZ.T_PRENATAL_SCREENING SET "trisomy13basesecond" = 0;

ALTER TABLE AKUZ.T_PRENATAL_SCREENING ALTER COLUMN "trisomy13basesecond" SET NOT NULL;

ALTER TABLE AKUZ.T_PRENATAL_SCREENING ADD "trisomy21first" integer NULL;

UPDATE AKUZ.T_PRENATAL_SCREENING SET "trisomy21first" = 0;

ALTER TABLE AKUZ.T_PRENATAL_SCREENING ALTER COLUMN "trisomy21first" SET NOT NULL;

ALTER TABLE AKUZ.T_PRENATAL_SCREENING ADD "trisomy18first" integer NULL;

UPDATE AKUZ.T_PRENATAL_SCREENING SET "trisomy18first" = 0;

ALTER TABLE AKUZ.T_PRENATAL_SCREENING ALTER COLUMN "trisomy18first" SET NOT NULL;

ALTER TABLE AKUZ.T_PRENATAL_SCREENING ADD "trisomy13first" integer NULL;

UPDATE AKUZ.T_PRENATAL_SCREENING SET "trisomy13first" = 0;

ALTER TABLE AKUZ.T_PRENATAL_SCREENING ALTER COLUMN "trisomy13first" SET NOT NULL;

ALTER TABLE AKUZ.T_PRENATAL_SCREENING ADD "preeclampsiariskfirst" integer NULL;

UPDATE AKUZ.T_PRENATAL_SCREENING SET "preeclampsiariskfirst" = 0;

ALTER TABLE AKUZ.T_PRENATAL_SCREENING ALTER COLUMN "preeclampsiariskfirst" SET NOT NULL;

ALTER TABLE AKUZ.T_PRENATAL_SCREENING ADD "fetalgrowthriskfirst" integer NULL;

UPDATE AKUZ.T_PRENATAL_SCREENING SET "fetalgrowthriskfirst" = 0;

ALTER TABLE AKUZ.T_PRENATAL_SCREENING ALTER COLUMN "fetalgrowthriskfirst" SET NOT NULL;

ALTER TABLE AKUZ.T_PRENATAL_SCREENING ADD "prematurebirthriskfirst" integer NULL;

UPDATE AKUZ.T_PRENATAL_SCREENING SET "prematurebirthriskfirst" = 0;

ALTER TABLE AKUZ.T_PRENATAL_SCREENING ALTER COLUMN "prematurebirthriskfirst" SET NOT NULL;

ALTER TABLE AKUZ.T_PRENATAL_SCREENING ADD "trisomy21second" integer NULL;

UPDATE AKUZ.T_PRENATAL_SCREENING SET "trisomy21second" = 0;

ALTER TABLE AKUZ.T_PRENATAL_SCREENING ALTER COLUMN "trisomy21second" SET NOT NULL;

ALTER TABLE AKUZ.T_PRENATAL_SCREENING ADD "trisomy18second" integer NULL;

UPDATE AKUZ.T_PRENATAL_SCREENING SET "trisomy18second" = 0;

ALTER TABLE AKUZ.T_PRENATAL_SCREENING ALTER COLUMN "trisomy18second" SET NOT NULL;

ALTER TABLE AKUZ.T_PRENATAL_SCREENING ADD "trisomy13second" integer NULL;

UPDATE AKUZ.T_PRENATAL_SCREENING SET "trisomy13second" = 0;

ALTER TABLE AKUZ.T_PRENATAL_SCREENING ALTER COLUMN "trisomy13second" SET NOT NULL;

ALTER TABLE AKUZ.T_PRENATAL_SCREENING ADD "preeclampsiarisksecond" integer NULL;

UPDATE AKUZ.T_PRENATAL_SCREENING SET "preeclampsiarisksecond" = 0;

ALTER TABLE AKUZ.T_PRENATAL_SCREENING ALTER COLUMN "preeclampsiarisksecond" SET NOT NULL;

ALTER TABLE AKUZ.T_PRENATAL_SCREENING ADD "fetalgrowthrisksecond" integer NULL;

UPDATE AKUZ.T_PRENATAL_SCREENING SET "fetalgrowthrisksecond" = 0;

ALTER TABLE AKUZ.T_PRENATAL_SCREENING ALTER COLUMN "fetalgrowthrisksecond" SET NOT NULL;

ALTER TABLE AKUZ.T_PRENATAL_SCREENING ADD "prematurebirthrisksecond" integer NULL;

UPDATE AKUZ.T_PRENATAL_SCREENING SET "prematurebirthrisksecond" = 0;

ALTER TABLE AKUZ.T_PRENATAL_SCREENING ALTER COLUMN "prematurebirthrisksecond" SET NOT NULL;

ALTER TABLE AKUZ.T_PRENATAL_SCREENING ADD "trisomy21ehrrus2glkfs0nqj" uuid NULL;

ALTER TABLE AKUZ.T_PRENATAL_SCREENING ADD "trisomy18ehrrus2glkfs0nqj" uuid NULL;

ALTER TABLE AKUZ.T_PRENATAL_SCREENING ADD "trisomy13ehrrus2glkfs0nqj" uuid NULL;

ALTER TABLE AKUZ.T_PRENATAL_SCREENING ADD "preeclampsiariskehrrus2glkfs0nqj" uuid NULL;

ALTER TABLE AKUZ.T_PRENATAL_SCREENING ADD "fetalgrowthriskehrrus2glkfs0nqj" uuid NULL;

ALTER TABLE AKUZ.T_PRENATAL_SCREENING ADD "prematurebirthriskehrrus2glkfs0nqj" uuid NULL;

ALTER TABLE AKUZ.T_PRENATAL_SCREENING ADD "recorddate" timestamp NULL;

ALTER TABLE AKUZ.T_PRENATAL_SCREENING ADD "users" uuid NULL;

ALTER TABLE AKUZ.T_PRENATAL_SCREENING ADD CONSTRAINT FK_T_EHR_RUS_2GLKFS0NQJ_T_PRENATAL_SCREENING_Trisomy21_3B2C7D2A
FOREIGN KEY("trisomy21ehrrus2glkfs0nqj") REFERENCES EHR.T_EHR_RUS_2GLKFS0NQJ (EhrRusID);

ALTER TABLE AKUZ.T_PRENATAL_SCREENING ADD CONSTRAINT FK_T_EHR_RUS_2GLKFS0NQJ_T_PRENATAL_SCREENING_Trisomy18_B01C2495
FOREIGN KEY("trisomy18ehrrus2glkfs0nqj") REFERENCES EHR.T_EHR_RUS_2GLKFS0NQJ (EhrRusID);

ALTER TABLE AKUZ.T_PRENATAL_SCREENING ADD CONSTRAINT FK_T_EHR_RUS_2GLKFS0NQJ_T_PRENATAL_SCREENING_Trisomy13_0596308F
FOREIGN KEY("trisomy13ehrrus2glkfs0nqj") REFERENCES EHR.T_EHR_RUS_2GLKFS0NQJ (EhrRusID);

ALTER TABLE AKUZ.T_PRENATAL_SCREENING ADD CONSTRAINT FK_T_EHR_RUS_2GLKFS0NQJ_T_PRENATAL_SCREENING_Preeclamp_2FE0ECBB
FOREIGN KEY("preeclampsiariskehrrus2glkfs0nqj") REFERENCES EHR.T_EHR_RUS_2GLKFS0NQJ (EhrRusID);

ALTER TABLE AKUZ.T_PRENATAL_SCREENING ADD CONSTRAINT FK_T_EHR_RUS_2GLKFS0NQJ_T_PRENATAL_SCREENING_FetalGrow_C483D7CA
FOREIGN KEY("fetalgrowthriskehrrus2glkfs0nqj") REFERENCES EHR.T_EHR_RUS_2GLKFS0NQJ (EhrRusID);

ALTER TABLE AKUZ.T_PRENATAL_SCREENING ADD CONSTRAINT FK_T_EHR_RUS_2GLKFS0NQJ_T_PRENATAL_SCREENING_Premature_0996EEBC
FOREIGN KEY("prematurebirthriskehrrus2glkfs0nqj") REFERENCES EHR.T_EHR_RUS_2GLKFS0NQJ (EhrRusID);

ALTER TABLE AKUZ.T_PRENATAL_SCREENING ADD CONSTRAINT FK_T_USERS_T_PRENATAL_SCREENING_Users
FOREIGN KEY("users") REFERENCES AKUZ.T_USERS (UserID);

