debian-mirror-gitlab/db/migrate/20140502125220_migrate_repo_size.rb

22 lines
388 B
Ruby
Raw Normal View History

2014-09-02 18:07:02 +05:30
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