repositories=Repository.find_by_sql("select * from repositories where project_id in (select project_id from repositories group by project_id having count(project_id) > 1);")
repositories.eachdo|rep|
puts"#{rep.id}"
ifrep.type=="Repository::Git"
rep.destroy
end
end
# Repository.where("project_id in (161,236,266)").destroy_all