if not exists (select * from sys.syscolumns where name = 'ImageName' and id = object_id(N'dbo.RepositoryHistory'))
begin
    alter table dbo.RepositoryHistory add ImageName nvarchar(256) null
        ,IsAllowedOffline bit null
        ,RepositorySettings nvarchar(max) null
end