2007-01-31 21:18:43 +00:00
|
|
|
class AddTrackerPosition < ActiveRecord::Migration
|
|
|
|
def self.up
|
2007-10-22 21:07:13 +00:00
|
|
|
add_column :trackers, :position, :integer, :default => 1
|
2012-12-02 20:28:37 +00:00
|
|
|
Tracker.all.each_with_index {|tracker, i| tracker.update_attribute(:position, i+1)}
|
2007-01-31 21:18:43 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def self.down
|
|
|
|
remove_column :trackers, :position
|
|
|
|
end
|
|
|
|
end
|