CREATE TABLE [dbo].[acc_cl_bordereaux_accounts_details]
(
[clbad_bordereau_id] [int] NOT NULL,
[clbad_account_id] [int] NOT NULL,
[clbad_account_id__payrec] [int] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[acc_cl_bordereaux_accounts_details] ADD CONSTRAINT [PK_acc_cl_bordereaux_accounts_details] PRIMARY KEY CLUSTERED  ([clbad_bordereau_id], [clbad_account_id], [clbad_account_id__payrec]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[acc_cl_bordereaux_accounts_details] ADD CONSTRAINT [FK_acc_cl_bordereaux_accounts_details_acc_accounts] FOREIGN KEY ([clbad_account_id]) REFERENCES [dbo].[acc_accounts] ([a_account_id])
GO
ALTER TABLE [dbo].[acc_cl_bordereaux_accounts_details] ADD CONSTRAINT [FK_acc_cl_bordereaux_accounts_details_acc_accounts1] FOREIGN KEY ([clbad_account_id__payrec]) REFERENCES [dbo].[acc_accounts] ([a_account_id])
GO
ALTER TABLE [dbo].[acc_cl_bordereaux_accounts_details] ADD CONSTRAINT [FK_acc_cl_bordereaux_accounts_details_acc_cl_bordereaux_accounts] FOREIGN KEY ([clbad_bordereau_id], [clbad_account_id]) REFERENCES [dbo].[acc_cl_bordereaux_accounts] ([clba_bordereau_id], [clba_account_id])
GO
