Merge pull request #152 from Alex-Ikanow/update_handler_text_size

#141 change delayed_job.handler to mediumtext (16MB) like event.payload

Andrew Cantino 11 years ago
parent
commit
b16f1053ad
1 changed files with 19 additions and 0 deletions
  1. 19 0
      db/migrate/20140127164931_change_handler_to_medium_text.rb

+ 19 - 0
db/migrate/20140127164931_change_handler_to_medium_text.rb

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