20140127164931_change_handler_to_medium_text.rb 422 B

12345678910111213141516171819
  1. # Increase handler size to 16MB (consistent with events.payload)
  2. class ChangeHandlerToMediumText < ActiveRecord::Migration
  3. def up
  4. if mysql?
  5. change_column :delayed_jobs, :handler, :text, :limit => 16777215
  6. end
  7. end
  8. def down
  9. if mysql?
  10. change_column :delayed_jobs, :handler, :text, :limit => 65535
  11. end
  12. end
  13. def mysql?
  14. ActiveRecord::Base.connection.adapter_name =~ /mysql/i
  15. end
  16. end