-- Tables

-- Alters

DELETE FROM AKUZ.T_PROCEDURE_JOURNAL_NOTE;

ALTER TABLE AKUZ.T_PROCEDURE_JOURNAL_NOTE DROP CONSTRAINT FK_T_RESEARCH_T_PROCEDURE_JOURNAL_NOTE_Research;

ALTER TABLE AKUZ.T_PROCEDURE_JOURNAL_NOTE DROP COLUMN "research";


ALTER TABLE AKUZ.T_PROCEDURE_JOURNAL_NOTE ADD "procedure" uuid NULL;

UPDATE AKUZ.T_PROCEDURE_JOURNAL_NOTE SET "procedure" = '00000000-0000-0000-0000-000000000000';

ALTER TABLE AKUZ.T_PROCEDURE_JOURNAL_NOTE ALTER COLUMN "procedure" SET NOT NULL;

ALTER TABLE AKUZ.T_PROCEDURE_JOURNAL_NOTE ADD CONSTRAINT FK_T_MEDICAL_SERVICE_T_PROCEDURE_JOURNAL_NOTE_Procedure
FOREIGN KEY("procedure") REFERENCES AKUZ.T_MEDICAL_SERVICE (MedicalServiceID);
