summaryrefslogtreecommitdiffstats
path: root/db/migrate/20141029181824_remove_issue_statuses_is_default.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2014-11-02 19:45:14 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2014-11-02 19:45:14 +0000
commitdfc594c33702a123674dcae1d6b4bfe3a2f32fd3 (patch)
tree42f8653451b35f54db68bf914e1d963bfaf13418 /db/migrate/20141029181824_remove_issue_statuses_is_default.rb
parent32b79b6fd4e3a523ee393d7a3e2bb60dbeed77c3 (diff)
downloadredmine-dfc594c33702a123674dcae1d6b4bfe3a2f32fd3.tar.gz
redmine-dfc594c33702a123674dcae1d6b4bfe3a2f32fd3.zip
Default status per tracker (#5991).
git-svn-id: http://svn.redmine.org/redmine/trunk@13535 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'db/migrate/20141029181824_remove_issue_statuses_is_default.rb')
-rw-r--r--db/migrate/20141029181824_remove_issue_statuses_is_default.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/db/migrate/20141029181824_remove_issue_statuses_is_default.rb b/db/migrate/20141029181824_remove_issue_statuses_is_default.rb
new file mode 100644
index 000000000..67a1696c0
--- /dev/null
+++ b/db/migrate/20141029181824_remove_issue_statuses_is_default.rb
@@ -0,0 +1,12 @@
+class RemoveIssueStatusesIsDefault < ActiveRecord::Migration
+ def up
+ remove_column :issue_statuses, :is_default
+ end
+
+ def down
+ add_column :issue_statuses, :is_default, :boolean, :null => false, :default => false
+ # Restores the first status as default
+ default_status_id = IssueStatus.order("position").first.pluck(:id)
+ IssueStatus.where(:id => default_status_id).update_all(:is_default => true)
+ end
+end