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

CREATE TABLE [AKUZ].[T_LLO_PRODUCTS_FOR_OTHER_MO]
(
    [LloProductsForOtherMoID] uniqueidentifier NOT NULL,
    [MedicationForms] uniqueidentifier NOT NULL,
    [DoseView] int NOT NULL,
    [LpuMain] uniqueidentifier NOT NULL,
    [CMnn] uniqueidentifier NOT NULL
)
ON [PRIMARY]
GO

ALTER TABLE [AKUZ].[T_LLO_PRODUCTS_FOR_OTHER_MO] ADD CONSTRAINT [PK_T_LLO_PRODUCTS_FOR_OTHER_MO]
PRIMARY KEY CLUSTERED ([LloProductsForOtherMoID]) ON [PRIMARY]
GO

ALTER TABLE [AKUZ].[T_LLO_PRODUCTS_FOR_OTHER_MO] ADD CONSTRAINT [FK_T_MEDICATION_FORMS_T_LLO_PRODUCTS_FOR_OTHER_MO_MedicationForms]
FOREIGN KEY([MedicationForms]) REFERENCES [PHARM].[T_MEDICATION_FORMS] ([MedicationFormsID])
GO

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])
GO

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])
GO

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])
GO

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

ALTER TABLE [AKUZ].[T_RECIPE_GENERAL] ADD [ProductOwner] uniqueidentifier NULL
GO

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])
GO