--**************************************************************************
--     Table: dbo.Repository
--    Author: Ron Savage
--      Date: 09/28/2008
--
-- Description:
-- This table is used to store a list of configuration files and thier 
-- content along with creation / update users and dates.
--
-- Modification History:
-- Date        Init  Comment
-- 10/17/2008  RS    Changed content field to varbinary(MAX) rather than text to store any file.
--                   Updated the cr_nam index to be unique on filename.
-- 09/28/2008  RS    Created.
--**************************************************************************

if exists (select * from dbo.sysobjects where  name = 'Repository') drop table Repository;
go

create table dbo.Repository
   (
   config_id        integer identity Primary Key,
   filename         varchar(100),
   created_by       varchar(40) default user,
   created_system   varchar(40) default host_name(),
   create_date      datetime default getdate(),
   updated_by       varchar(40) default user,
   updated_system   varchar(40) default host_name(),
   last_updated     datetime default getdate(),
   content          varbinary(MAX)
   )
go

create unique index cr_nam    on dbo.Repository (filename);
go
