2013-02-18 15:54:30 +01:00
|
|
|
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'")
|
2013-02-18 15:54:30 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def down
|
|
|
|
Milestone.transaction do
|
2013-02-19 08:32:10 +01:00
|
|
|
Milestone.where(state: :closed).update_all("closed = 1")
|
2013-02-18 15:54:30 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|