CREATE TABLE [dbo].[pr_families_branches]
(
[pfb_family_code] [dbo].[ais_code_short] NOT NULL,
[pfb_branch_id] [int] NOT NULL,
[pfb_policy_scen_code] [dbo].[ais_code_short] NULL,
[pfb_risk_scen_code] [dbo].[ais_code_short] NULL,
[pfb_claim_scen_code] [dbo].[ais_code_short] NULL,
[pfb_group_code__class] [dbo].[ais_code_short] NULL,
[pfb_group_code__zone] [dbo].[ais_code_short] NULL,
[pfb_group_code__usage] [dbo].[ais_code_short] NULL,
[pfb_culture_code__default_cli] [dbo].[ais_code_short] NULL,
[pfb_index] [bit] NOT NULL CONSTRAINT [DF__pr_families_branches__pfb_index] DEFAULT ((0)),
[pfb_index_code] [dbo].[ais_code_medium] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[pr_families_branches] ADD CONSTRAINT [PK_pr_families_branches] PRIMARY KEY CLUSTERED  ([pfb_family_code], [pfb_branch_id]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[pr_families_branches] ADD CONSTRAINT [FK_pr_families_branches_act_branches] FOREIGN KEY ([pfb_branch_id]) REFERENCES [dbo].[act_branches] ([br_actor_id])
GO
ALTER TABLE [dbo].[pr_families_branches] ADD CONSTRAINT [FK_pr_families_branches_dyn_scenarios] FOREIGN KEY ([pfb_policy_scen_code]) REFERENCES [dbo].[dyn_scenarios] ([sc_scen_code])
GO
ALTER TABLE [dbo].[pr_families_branches] ADD CONSTRAINT [FK_pr_families_branches_dyn_scenarios1] FOREIGN KEY ([pfb_risk_scen_code]) REFERENCES [dbo].[dyn_scenarios] ([sc_scen_code])
GO
ALTER TABLE [dbo].[pr_families_branches] ADD CONSTRAINT [FK_pr_families_branches_dyn_scenarios2] FOREIGN KEY ([pfb_claim_scen_code]) REFERENCES [dbo].[dyn_scenarios] ([sc_scen_code])
GO
ALTER TABLE [dbo].[pr_families_branches] ADD CONSTRAINT [FK_pr_families_branches_grpcls_groups] FOREIGN KEY ([pfb_group_code__class]) REFERENCES [dbo].[grpcls_groups] ([clsg_group_code])
GO
ALTER TABLE [dbo].[pr_families_branches] ADD CONSTRAINT [FK_pr_families_branches_grpusg_groups] FOREIGN KEY ([pfb_group_code__usage]) REFERENCES [dbo].[grpusg_groups] ([usgg_group_code])
GO
ALTER TABLE [dbo].[pr_families_branches] ADD CONSTRAINT [FK_pr_families_branches_grpzon_groups] FOREIGN KEY ([pfb_group_code__zone]) REFERENCES [dbo].[grpzon_groups] ([zong_group_code])
GO
ALTER TABLE [dbo].[pr_families_branches] ADD CONSTRAINT [FK_pr_families_branches_md_cultures] FOREIGN KEY ([pfb_culture_code__default_cli]) REFERENCES [dbo].[md_cultures] ([clt_culture_code])
GO
ALTER TABLE [dbo].[pr_families_branches] ADD CONSTRAINT [FK_pr_families_branches_nm_indices] FOREIGN KEY ([pfb_index_code]) REFERENCES [dbo].[nm_indices] ([idx_index_code])
GO
ALTER TABLE [dbo].[pr_families_branches] ADD CONSTRAINT [FK_pr_families_branches_pr_families] FOREIGN KEY ([pfb_family_code]) REFERENCES [dbo].[pr_families] ([pf_family_code])
GO
