diff --git a/db/migrate/20140127164931_change_handler_to_medium_text.rb b/db/migrate/20140127164931_change_handler_to_medium_text.rb new file mode 100644 index 00000000..ad00e9be --- /dev/null +++ b/db/migrate/20140127164931_change_handler_to_medium_text.rb @@ -0,0 +1,19 @@ +# Increase handler size to 16MB (consistent with events.payload) + +class ChangeHandlerToMediumText < ActiveRecord::Migration + def up + if mysql? + change_column :delayed_jobs, :handler, :text, :limit => 16777215 + end + end + + def down + if mysql? + change_column :delayed_jobs, :handler, :text, :limit => 65535 + end + end + + def mysql? + ActiveRecord::Base.connection.adapter_name =~ /mysql/i + end +end \ No newline at end of file