Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save rafbm/5289038 to your computer and use it in GitHub Desktop.
Save rafbm/5289038 to your computer and use it in GitHub Desktop.
ActiveRecord migration for increasing MySQL column length from TEXT to MEDIUMTEXT
class IncreaseDelayedJobsHandlerLength < ActiveRecord::Migration
def up
# Increase to MEDIUMTEXT (16,777,215 bytes)
change_column(:delayed_jobs, :handler, :text, limit: 16.megabytes - 1)
end
def down
# Back to default TEXT (65,535 bytes)
change_column(:delayed_jobs, :handler, :text)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment