-- Tables

-- Alters

ALTER TABLE AKUZ.T_ONK_CYTOLOGY_RESULT_BASE ADD "pathologistpost" integer NULL;

update AKUZ.T_ONK_CYTOLOGY_RESULT_BASE cb
    set "pathologistpost" = mr.Post
from AKUZ.T_MEDICAL_RECORD mr
where mr.MedicalRecordID = cb.MedicalRecordID;

ALTER TABLE AKUZ.T_ONK_CYTOLOGY_RESULT_BASE ADD CONSTRAINT FK_T_POST_T_ONK_CYTOLOGY_RESULT_BASE_PathologistPost
FOREIGN KEY("pathologistpost") REFERENCES AKUZ.T_POST (ResourceID);

