Welcome to mirror list, hosted at ThFree Co, Russian Federation.

20130218141344_convert_closed_to_state_in_milestone.rb « migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 1978ea8915390ac6a76e6ccdc49d143e2ce53a7e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
class ConvertClosedToStateInMilestone < ActiveRecord::Migration
  def up
    Milestone.transaction do
      Milestone.where(closed: true).update_all(state: :closed)
      Milestone.where(closed: false).update_all(state: :active)
    end
  end

  def down
    Milestone.transaction do
      Milestone.where(state: :closed).update_all(closed: true)
    end
  end
end