Sha256: cd167cfb82f91c786e8170d89e4316b3b613cef23b76a6fcdb54dc99dcb3bc26
Contents?: true
Size: 1.24 KB
Versions: 3
Compression:
Stored size: 1.24 KB
Contents
class CreateDelayedJobs < ActiveRecord::Migration def self.up create_table :delayed_jobs, :force => true do |t| t.integer :priority, :default => 0 # Allows some jobs to jump to the front of the queue t.integer :attempts, :default => 0 # Provides for retries, but still fail eventually. t.text :handler # YAML-encoded string of the object that will do work t.string :job_type # Class name of the job object, for type-specific workers t.string :last_error # reason for last failure (See Note below) t.datetime :run_at # When to run. Could be Time.now for immediately, or sometime in the future. t.datetime :locked_at # Set when a client is working on this object t.datetime :failed_at # Set when all retries have failed (actually, by default, the record is deleted instead) t.string :locked_by # Who is working on this object (if locked) t.timestamps end add_index :delayed_jobs, :locked_by add_index :delayed_jobs, :job_type add_index :delayed_jobs, :priority end def self.down drop_table :delayed_jobs end end
Version data entries
3 entries across 3 versions & 1 rubygems