CREATE TABLE [dbo].[act_branches]
(
[br_actor_id] [int] NOT NULL,
[br_rowver] [timestamp] NOT NULL,
[br_currency_code] [dbo].[ais_code_short] NOT NULL,
[br_chain_code] [dbo].[ais_code_short] NULL,
[br_display_name] [nvarchar] (64) COLLATE French_CI_AS NULL,
[br_short_code] [dbo].[ais_code_short] NULL,
[br_culture_code] [dbo].[ais_code_short] NULL,
[br_smtpserver_code] [dbo].[ais_code_short] NULL,
[br_url] [varchar] (512) COLLATE French_CI_AS NULL,
[br_monthly_payment_code] [dbo].[ais_code_short] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[act_branches] ADD CONSTRAINT [PK_act_branches] PRIMARY KEY CLUSTERED  ([br_actor_id]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[act_branches] ADD CONSTRAINT [FK_act_branches_acc_currencies] FOREIGN KEY ([br_currency_code]) REFERENCES [dbo].[acc_currencies] ([cur_currency_code])
GO
ALTER TABLE [dbo].[act_branches] ADD CONSTRAINT [FK_act_branches_act_actors] FOREIGN KEY ([br_actor_id]) REFERENCES [dbo].[act_actors] ([act_actor_id])
GO
ALTER TABLE [dbo].[act_branches] ADD CONSTRAINT [FK_act_branches_cts_chains] FOREIGN KEY ([br_chain_code]) REFERENCES [dbo].[cts_chains] ([ctsch_chain_code])
GO
ALTER TABLE [dbo].[act_branches] ADD CONSTRAINT [FK_act_branches_md_cultures] FOREIGN KEY ([br_culture_code]) REFERENCES [dbo].[md_cultures] ([clt_culture_code]) ON UPDATE CASCADE
GO
ALTER TABLE [dbo].[act_branches] ADD CONSTRAINT [FK_act_branches_nm_pol_monthly_payments] FOREIGN KEY ([br_monthly_payment_code]) REFERENCES [dbo].[nm_pol_monthly_payments] ([nmpmp_monthly_payment_code])
GO
ALTER TABLE [dbo].[act_branches] ADD CONSTRAINT [FK_act_branches_nm_smtp_servers] FOREIGN KEY ([br_smtpserver_code]) REFERENCES [dbo].[nm_smtp_servers] ([smtp_smtpserver_code])
GO
