Permalink
Browse files

Contribute an ActiveRecord::Migration that adds the queue column to a…

…n existing delayed_jobs table
  • Loading branch information...
1 parent 0cd1110 commit cb0c6a1e258e5727964a0169b9ff45fd5071b62f @johndouthat committed Feb 19, 2012
Showing with 13 additions and 0 deletions.
  1. +13 −0 contrib/add_queue_to_delayed_jobs.rb
@@ -0,0 +1,13 @@
+class AddQueueToDelayedJobs < ActiveRecord::Migration
+ def self.up
+ add_column :delayed_jobs, :queue, :string
+ remove_index :delayed_jobs, :delayed_jobs_priority
+ add_index :delayed_jobs, [:priority, :run_at, :queue], :name => 'delayed_jobs_priority'
+ end
+
+ def self.down
+ remove_index :delayed_jobs, :name => 'delayed_jobs_priority'
+ add_index :delayed_jobs, [:priority, :run_at], :name => 'delayed_jobs_priority'
+ remove_column :delayed_jobs, :queue
+ end
+end

0 comments on commit cb0c6a1

Please sign in to comment.