CREATE TABLE [dbo].[nm_endorsment_patterns_families]
(
[nmeppf_act_code] [dbo].[ais_code_short] NOT NULL,
[nmeppf_endorsmentpattern_code] [dbo].[ais_code_short] NOT NULL,
[nmeppf_family_code] [dbo].[ais_code_short] NOT NULL,
[nmeppf_premium_refundable] [bit] NOT NULL CONSTRAINT [DF__nm_endorsment_patterns_families__nmeppf_premium_refundable] DEFAULT ((0))
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[nm_endorsment_patterns_families] ADD CONSTRAINT [PK_nm_endorsment_patterns_families] PRIMARY KEY CLUSTERED  ([nmeppf_act_code], [nmeppf_endorsmentpattern_code], [nmeppf_family_code]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[nm_endorsment_patterns_families] ADD CONSTRAINT [FK_nm_endorsment_patterns_families_pol_acts] FOREIGN KEY ([nmeppf_act_code]) REFERENCES [dbo].[pol_acts] ([pact_act_code])
GO
ALTER TABLE [dbo].[nm_endorsment_patterns_families] ADD CONSTRAINT [FK_nm_endorsment_patterns_families_nm_endorsement_patterns] FOREIGN KEY ([nmeppf_act_code], [nmeppf_endorsmentpattern_code]) REFERENCES [dbo].[nm_endorsement_patterns] ([nmep_act_code], [nmep_endorsmentpattern_code])
GO
ALTER TABLE [dbo].[nm_endorsment_patterns_families] ADD CONSTRAINT [FK_nm_endorsment_patterns_families_pr_families] FOREIGN KEY ([nmeppf_family_code]) REFERENCES [dbo].[pr_families] ([pf_family_code])
GO
