if not exists (select * from sys.sysobjects where id = object_id(N'dbo.EntryExpiringHistory')) begin
   create table dbo.EntryExpiringHistory (
    ID int identity not null,
    Added datetime not null constraint DF_EntryExpiringNotification_Added default getutcdate(),
    ConnectionID uniqueidentifier not null,
    Description nvarchar(max) null,
    Name varchar(200),
    GroupName varchar(400),
    InDays int not null,
    Expiration datetime not null,
    ConnectionType varchar(100),
    ConnectionSubType varchar(100),
    RepositoryID uniqueidentifier not null,
    EventProcessed bit not null constraint DF_EntryExpiringHistory_EventProcessed default (0),
    constraint PK_EntryExpiringHistory primary key clustered (ID)
  );
end;