Sha256: 17a1d03ad1986d2daf2c19171185eaec2531702964222a17905706c0ca249887

Contents?: true

Size: 635 Bytes

Versions: 5

Compression:

Stored size: 635 Bytes

Contents

class CreateJobs < ActiveRecord::Migration
  def self.up
    create_table :jobs do |t|
      t.string  :worker_class
      t.string  :worker_method
      
      t.text    :args
      t.integer :priority

      t.integer :progress
      t.string  :state
      
      t.integer :lock_version, :default => 0
      
      t.timestamp :start_at
      t.timestamp :started_at
      t.timestamps
      
      t.columns << 'result longtext' # text can store 65kb only, it's often too short
    end

    add_index :jobs, :state
    add_index :jobs, :start_at
    add_index :jobs, :priority
  end

  def self.down
    drop_table :jobs
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ncr-background_fu-1.0.2 generators/background/templates/migration.rb
ncr-background_fu-1.0.4 generators/background/templates/migration.rb
ncr-background_fu-1.0.5 generators/background/templates/migration.rb
ncr-background_fu-1.0.6 generators/background/templates/migration.rb
ncr-background_fu-1.0.7 generators/background/templates/migration.rb