18 lines
373 B
Ruby
18 lines
373 B
Ruby
class IndexJobsOnLockedBy < ActiveRecord::Migration
|
|
tag :predeploy
|
|
|
|
self.transactional = false
|
|
|
|
def self.connection
|
|
Delayed::Backend::ActiveRecord::Job.connection
|
|
end
|
|
|
|
def self.up
|
|
add_index :delayed_jobs, :locked_by, :concurrently => true, :conditions => "locked_by IS NOT NULL"
|
|
end
|
|
|
|
def self.down
|
|
remove_index :delayed_jobs, :locked_by
|
|
end
|
|
end
|