2019-05-02 18:17:27 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-08-31 00:06:56 -04:00
|
|
|
class RenameAutoCloseDaysToHours < ActiveRecord::Migration[4.2]
|
2013-12-06 16:39:35 -05:00
|
|
|
def up
|
|
|
|
rename_column :categories, :auto_close_days, :auto_close_hours
|
|
|
|
execute "update categories set auto_close_hours = auto_close_hours * 24"
|
|
|
|
end
|
|
|
|
|
|
|
|
def down
|
|
|
|
rename_column :categories, :auto_close_hours, :auto_close_days
|
|
|
|
execute "update categories set auto_close_days = auto_close_days / 24"
|
|
|
|
end
|
|
|
|
end
|