CREATE TABLE [dbo].[pr_products_variables_branches_repartitions]
(
[prdvbr_variable_id] [int] NOT NULL,
[prdvbr_branch_id] [int] NOT NULL,
[prdvbr_company_id] [int] NOT NULL,
[prdvbr_company_id__2] [int] NOT NULL,
[prdvbr_commission_value] [dbo].[ais_decimal4] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[pr_products_variables_branches_repartitions] ADD CONSTRAINT [PK_pr_products_variables_branches_repartitions] PRIMARY KEY CLUSTERED  ([prdvbr_variable_id], [prdvbr_branch_id], [prdvbr_company_id], [prdvbr_company_id__2]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[pr_products_variables_branches_repartitions] ADD CONSTRAINT [FK_pr_products_variables_branches_repartitions_act_cies_repartitions] FOREIGN KEY ([prdvbr_company_id], [prdvbr_company_id__2]) REFERENCES [dbo].[act_cies_repartitions] ([cier_company_id], [cier_company_id__2])
GO
ALTER TABLE [dbo].[pr_products_variables_branches_repartitions] ADD CONSTRAINT [FK_pr_products_variables_branches_repartitions_pr_products_variables_branches] FOREIGN KEY ([prdvbr_variable_id], [prdvbr_branch_id]) REFERENCES [dbo].[pr_products_variables_branches] ([prdvb_variable_id], [prdvb_branch_id])
GO
