CREATE TABLE [dbo].[doc_collections_docs_accounts]
(
[dcda_document_id] [int] NOT NULL,
[dcda_account_id] [int] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[doc_collections_docs_accounts] ADD CONSTRAINT [PK_doc_collections_docs_accounts] PRIMARY KEY CLUSTERED  ([dcda_document_id], [dcda_account_id]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[doc_collections_docs_accounts] ADD CONSTRAINT [FK_doc_collections_docs_accounts_acc_accounts] FOREIGN KEY ([dcda_account_id]) REFERENCES [dbo].[acc_accounts] ([a_account_id])
GO
ALTER TABLE [dbo].[doc_collections_docs_accounts] ADD CONSTRAINT [FK_doc_collections_docs_accounts_doc_collections_docs] FOREIGN KEY ([dcda_document_id]) REFERENCES [dbo].[doc_collections_docs] ([dcd_document_id])
GO
