CREATE TABLE [dbo].[acc_cl_bordereaux_accounts]
(
[clba_bordereau_id] [int] NOT NULL,
[clba_account_id] [int] NOT NULL,
[clba_operation_code] [dbo].[ais_code_short] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[acc_cl_bordereaux_accounts] ADD CONSTRAINT [PK_acc_cl_bordereaux_accounts] PRIMARY KEY CLUSTERED  ([clba_bordereau_id], [clba_account_id]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[acc_cl_bordereaux_accounts] ADD CONSTRAINT [FK_acc_cl_bordereaux_accounts_acc_accounts] FOREIGN KEY ([clba_account_id]) REFERENCES [dbo].[acc_accounts] ([a_account_id])
GO
ALTER TABLE [dbo].[acc_cl_bordereaux_accounts] ADD CONSTRAINT [FK_acc_cl_bordereaux_accounts_acc_cl_bordereaux] FOREIGN KEY ([clba_bordereau_id]) REFERENCES [dbo].[acc_cl_bordereaux] ([clb_bordereau_id])
GO
ALTER TABLE [dbo].[acc_cl_bordereaux_accounts] ADD CONSTRAINT [FK_acc_cl_bordereaux_accounts_nm_accounts_operations] FOREIGN KEY ([clba_operation_code]) REFERENCES [dbo].[nm_accounts_operations] ([aco_operation_code])
GO
