CREATE TABLE [dbo].[acc_cl_bordereaux]
(
[clb_bordereau_id] [int] NOT NULL,
[clb_branch_id] [int] NOT NULL,
[clb_user_code] [dbo].[ais_code_medium] NOT NULL,
[clb_operation_utc_date] [datetime] NOT NULL,
[clb_payments] [bit] NOT NULL CONSTRAINT [DF__acc_cl_bordereaux__clb_payments] DEFAULT ((0)),
[clb_recoveries] [bit] NOT NULL CONSTRAINT [DF__acc_cl_bordereaux__clb_recoveries] DEFAULT ((0)),
[clb_reference] [nvarchar] (50) COLLATE French_CI_AS NULL,
[clb_actor_id] [int] NULL,
[clb_claim_id] [int] NULL,
[clb_currency_code] [dbo].[ais_code_short] NOT NULL,
[clb_sequence_code] [dbo].[ais_code_short] NULL,
[clb_date_from] [date] NULL,
[clb_date_to] [date] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[acc_cl_bordereaux] ADD CONSTRAINT [PK_acc_cl_bordereaux] PRIMARY KEY CLUSTERED  ([clb_bordereau_id]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[acc_cl_bordereaux] ADD CONSTRAINT [FK_acc_cl_bordereaux_acc_currencies] FOREIGN KEY ([clb_currency_code]) REFERENCES [dbo].[acc_currencies] ([cur_currency_code])
GO
ALTER TABLE [dbo].[acc_cl_bordereaux] ADD CONSTRAINT [FK_acc_cl_bordereaux_act_actors] FOREIGN KEY ([clb_actor_id]) REFERENCES [dbo].[act_actors] ([act_actor_id])
GO
ALTER TABLE [dbo].[acc_cl_bordereaux] ADD CONSTRAINT [FK_acc_cl_bordereaux_act_branches] FOREIGN KEY ([clb_branch_id]) REFERENCES [dbo].[act_branches] ([br_actor_id])
GO
ALTER TABLE [dbo].[acc_cl_bordereaux] ADD CONSTRAINT [FK_acc_cl_bordereaux_claim_claims] FOREIGN KEY ([clb_claim_id]) REFERENCES [dbo].[claim_claims] ([cl_claim_id])
GO
ALTER TABLE [dbo].[acc_cl_bordereaux] ADD CONSTRAINT [FK_acc_cl_bordereaux_sq_sequences] FOREIGN KEY ([clb_sequence_code]) REFERENCES [dbo].[sq_sequences] ([seq_sequence_code])
GO
ALTER TABLE [dbo].[acc_cl_bordereaux] ADD CONSTRAINT [FK_acc_cl_bordereaux_usr_users] FOREIGN KEY ([clb_user_code]) REFERENCES [dbo].[usr_users] ([usr_user_code])
GO
