gitlabhq/db/migrate/20130218141344_convert_closed_to_state_in_milestone.rb
2013-02-27 12:53:36 +04:00

14 lines
365 B
Ruby

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