You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20141029181824_remove_issue_statuses_is_default.rb 425B

123456789101112
  1. class RemoveIssueStatusesIsDefault < ActiveRecord::Migration[4.2]
  2. def up
  3. remove_column :issue_statuses, :is_default
  4. end
  5. def down
  6. add_column :issue_statuses, :is_default, :boolean, :null => false, :default => false
  7. # Restores the first status as default
  8. default_status_id = IssueStatus.order(:position).pick(:id)
  9. IssueStatus.where(:id => default_status_id).update_all(:is_default => true)
  10. end
  11. end