IF NOT EXISTS (SELECT 1 FROM [sys].[columns] WHERE [object_id] = OBJECT_ID(N'[dbo].[RepositoryHistory]') AND [name] = N'RepositoryType')
    ALTER TABLE [dbo].[RepositoryHistory] ADD [RepositoryType] TINYINT NULL;