if not exists (select * FROM sys.syscolumns where name = 'OriginalRepositoryID' AND id = object_id(N'dbo.ConnectionHistory'))
	alter table dbo.ConnectionHistory add OriginalRepositoryID uniqueidentifier null;