CREATE TABLE [dbo].[doc_collections]
(
[dc_collection_id] [int] NOT NULL,
[dc_type_code] [dbo].[ais_code_short] NOT NULL,
[dc_id] [int] NULL,
[dc_user_code] [dbo].[ais_code_medium] NOT NULL,
[dc_operation_utc_date] [datetime] NOT NULL,
[dc_obs] [nvarchar] (64) COLLATE French_CI_AS NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[doc_collections] ADD CONSTRAINT [PK_doc_collections] PRIMARY KEY CLUSTERED  ([dc_collection_id]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_doc_collections] ON [dbo].[doc_collections] ([dc_type_code], [dc_id]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[doc_collections] ADD CONSTRAINT [FK_doc_collections_doc_collections_types] FOREIGN KEY ([dc_type_code]) REFERENCES [dbo].[doc_collections_types] ([dct_type_code])
GO
ALTER TABLE [dbo].[doc_collections] ADD CONSTRAINT [FK_doc_collections_usr_users] FOREIGN KEY ([dc_user_code]) REFERENCES [dbo].[usr_users] ([usr_user_code])
GO
