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