/***** Object:  Table AKUZ.T_LLO_PRODUCTS_FOR_OTHER_MO *****/

CREATE TABLE AKUZ.T_LLO_PRODUCTS_FOR_OTHER_MO
(
    "lloproductsforothermoid" uuid NOT NULL,
    "medicationforms" uuid NOT NULL,
    "doseview" integer NOT NULL,
    "lpumain" uuid NOT NULL,
    "cmnn" uuid NOT NULL
);

ALTER TABLE AKUZ.T_LLO_PRODUCTS_FOR_OTHER_MO ADD CONSTRAINT PK_T_LLO_PRODUCTS_FOR_OTHER_MO
PRIMARY KEY (LloProductsForOtherMoID);

ALTER TABLE AKUZ.T_LLO_PRODUCTS_FOR_OTHER_MO ADD CONSTRAINT FK_T_MEDICATION_FORMS_T_LLO_PRODUCTS_FOR_OTHER_MO_Medi_06646BD4
FOREIGN KEY("medicationforms") REFERENCES PHARM.T_MEDICATION_FORMS (MedicationFormsID);

ALTER TABLE AKUZ.T_LLO_PRODUCTS_FOR_OTHER_MO ADD CONSTRAINT FK_S_DLO_DOSEVIEW_T_LLO_PRODUCTS_FOR_OTHER_MO_DoseView
FOREIGN KEY("doseview") REFERENCES AKUZ.S_DLO_DoseView (Id);

ALTER TABLE AKUZ.T_LLO_PRODUCTS_FOR_OTHER_MO ADD CONSTRAINT FK_T_LPU_MAIN_T_LLO_PRODUCTS_FOR_OTHER_MO_LpuMain
FOREIGN KEY("lpumain") REFERENCES AKUZ.T_LPU_MAIN (LpuID);

ALTER TABLE AKUZ.T_LLO_PRODUCTS_FOR_OTHER_MO ADD CONSTRAINT FK_T_C_MNN_T_LLO_PRODUCTS_FOR_OTHER_MO_CMnn
FOREIGN KEY("cmnn") REFERENCES PHARM.T_C_MNN (CMnnID);

/***** Object:  Table AKUZ.T_RECIPE_GENERAL *****/

ALTER TABLE AKUZ.T_RECIPE_GENERAL ADD "productowner" uuid NULL;

ALTER TABLE AKUZ.T_RECIPE_GENERAL ADD CONSTRAINT FK_T_LPU_MAIN_T_RECIPE_GENERAL_ProductOwner
FOREIGN KEY("productowner") REFERENCES AKUZ.T_LPU_MAIN (LpuID);