Commit b66f4898ea14bdfe271465fbcc9b133ae0bee4f1

Authored by Dmitriy Zaporozhets
1 parent 65cba5c6

Better message for migrating global projects

lib/tasks/migrate/migrate_global_projects.rake
1 desc "GITLAB | Migrate Global Projects to Namespaces" 1 desc "GITLAB | Migrate Global Projects to Namespaces"
2 task migrate_global_projects: :environment do 2 task migrate_global_projects: :environment do
3 - puts "This will move all projects without namespace to owner namespace"  
4 - ask_to_continue 3 + found = Project.where(namespace_id: nil).count
  4 + if found > 0
  5 + puts "Global namespace is deprecated. We found #{found} projects stored in global namespace".yellow
  6 + puts "You may abort this task and move them to group/user namespaces manually."
  7 + puts "If you want us to move this projects under owner namespaces then continue"
  8 + ask_to_continue
  9 + else
  10 + puts "No global projects found. Proceed with update.".green
  11 + end
5 12
6 Project.where(namespace_id: nil).find_each(batch_size: 20) do |project| 13 Project.where(namespace_id: nil).find_each(batch_size: 20) do |project|
7 begin 14 begin