To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.
root / db / migrate / 019_add_issue_status_position.rb @ 442:753f1380d6bc
History | View | Annotate | Download (311 Bytes)
| 1 |
class AddIssueStatusPosition < ActiveRecord::Migration |
|---|---|
| 2 |
def self.up |
| 3 |
add_column :issue_statuses, :position, :integer, :default => 1 |
| 4 |
IssueStatus.find(:all).each_with_index {|status, i| status.update_attribute(:position, i+1)} |
| 5 |
end
|
| 6 |
|
| 7 |
def self.down |
| 8 |
remove_column :issue_statuses, :position |
| 9 |
end
|
| 10 |
end
|