CREATE TABLE [dbo].[acc_invoices_policies_variables_introducers]
(
[invpolvi_invoice_id] [int] NOT NULL,
[invpolvi_policy_situation_id] [int] NOT NULL,
[invpolvi_variable_id] [int] NOT NULL,
[invpolvi_introducer_id] [int] NOT NULL,
[invpolvi_value] [dbo].[ais_decimal2] NULL,
[invpolvi_commission_sharing_deduced] [bit] NOT NULL CONSTRAINT [DF__acc_invoices_policies_variables_introducers__invpolvi_commission_sharing_deduced] DEFAULT ((0))
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[acc_invoices_policies_variables_introducers] ADD CONSTRAINT [PK_acc_invoices_policies_variables_introducers] PRIMARY KEY CLUSTERED  ([invpolvi_invoice_id], [invpolvi_policy_situation_id], [invpolvi_variable_id], [invpolvi_introducer_id]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[acc_invoices_policies_variables_introducers] ADD CONSTRAINT [FK_acc_invoices_policies_variables_introducers_acc_invoices_policies_variables] FOREIGN KEY ([invpolvi_invoice_id], [invpolvi_policy_situation_id], [invpolvi_variable_id]) REFERENCES [dbo].[acc_invoices_policies_variables] ([invpolv_invoice_id], [invpolv_policy_situation_id], [invpolv_variable_id])
GO
