if exists (select * from sys.check_constraints where name = 'CH_Repository_RepositoryType' and parent_object_id = object_id(N'dbo.Repository'))
    alter table dbo.Repository drop constraint CH_Repository_RepositoryType;