gitlabhq/db/migrate/20130218141258_convert_closed_to_state_in_issue.rb

15 lines
349 B
Ruby
Raw Normal View History

class ConvertClosedToStateInIssue < ActiveRecord::Migration
def up
Issue.transaction do
2013-02-19 08:32:10 +01:00
Issue.where(closed: true).update_all("state = 'closed'")
Issue.where(closed: false).update_all("state = 'opened'")
end
end
def down
Issue.transaction do
2013-02-19 08:32:10 +01:00
Issue.where(state: :closed).update_all("closed = 1")
end
end
end