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

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

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