CREATE TABLE [dbo].[pol_policies_situations_main_invoices]
(
[polmi_policy_situation_id] [int] NOT NULL,
[polmi_invoice_id] [int] NOT NULL
) ON [PRIMARY]
ALTER TABLE [dbo].[pol_policies_situations_main_invoices] ADD 
CONSTRAINT [PK_pol_policies_situations_main_invoices_1] PRIMARY KEY CLUSTERED  ([polmi_policy_situation_id], [polmi_invoice_id]) ON [PRIMARY]
GO

ALTER TABLE [dbo].[pol_policies_situations_main_invoices] ADD CONSTRAINT [FK_pol_policies_situations_main_invoices_acc_invoices] FOREIGN KEY ([polmi_invoice_id]) REFERENCES [dbo].[acc_invoices] ([inv_invoice_id])
GO
ALTER TABLE [dbo].[pol_policies_situations_main_invoices] ADD CONSTRAINT [FK_pol_policies_situations_main_invoices_pol_policies_situations] FOREIGN KEY ([polmi_policy_situation_id]) REFERENCES [dbo].[pol_policies_situations] ([pols_policy_situation_id])
GO
