summaryrefslogtreecommitdiff
path: root/db/migrate/20140502125220_migrate_repo_size.rb
blob: eed6d366814c5e956a0ee7fe7d5bd8bc974ff6d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
class MigrateRepoSize < ActiveRecord::Migration
  def up
    Project.reset_column_information
    Project.find_each(batch_size: 500) do |project|
      begin
        if project.empty_repo?
          print '-'
        else
          project.update_repository_size
          print '.'
        end
      rescue
        print 'F'
      end
    end
    puts 'Done'
  end

  def down
  end
end