gitlabhq/db/migrate/20130218141344_convert_closed_to_state_in_milestone.rb

15 lines
374 B
Ruby
Raw Normal View History

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