Skip to content

Commit

Permalink
improved console output in migration 018_fix_positions_again, too
Browse files Browse the repository at this point in the history
  • Loading branch information
maser committed Apr 15, 2011
1 parent 284e12e commit bc7d2fe
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions db/migrate/018_fix_story_positions_again.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
class FixStoryPositionsAgain < ActiveRecord::Migration
def self.up
ActiveRecord::Base.transaction do
c = Story.count(:conditions => "parent_id is NULL")
puts "setting position for #{c} issues"
Story.find(:all, :conditions => "parent_id is NULL", :order => "project_id ASC, fixed_version_id ASC, position ASC").each_with_index do |s,i|
puts "#{i} issues…" if i % 100 == 0 && i != 0
s.position=i+1
s.save!
end
Expand Down

0 comments on commit bc7d2fe

Please sign in to comment.