2007-01-31 22:53:24 +03:00
|
|
|
class AddIssueStatusPosition < ActiveRecord::Migration
|
|
|
|
def self.up
|
2007-10-23 01:07:13 +04:00
|
|
|
add_column :issue_statuses, :position, :integer, :default => 1
|
2007-01-31 22:53:24 +03:00
|
|
|
IssueStatus.find(:all).each_with_index {|status, i| status.update_attribute(:position, i+1)}
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.down
|
|
|
|
remove_column :issue_statuses, :position
|
|
|
|
end
|
|
|
|
end
|