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