summaryrefslogtreecommitdiffstats
path: root/db/migrate/019_add_issue_status_position.rb
diff options
context:
space:
mode:
Diffstat (limited to 'db/migrate/019_add_issue_status_position.rb')
-rw-r--r--db/migrate/019_add_issue_status_position.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/db/migrate/019_add_issue_status_position.rb b/db/migrate/019_add_issue_status_position.rb
new file mode 100644
index 000000000..1c65e52e3
--- /dev/null
+++ b/db/migrate/019_add_issue_status_position.rb
@@ -0,0 +1,10 @@
+class AddIssueStatusPosition < ActiveRecord::Migration
+ def self.up
+ add_column :issue_statuses, :position, :integer, :default => 1, :null => false
+ 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