Sha256: eb9a607ffc2e8f6ca71b90c495973cb4e8f4e36e7ee5bb4bf657ebd79061709a

Contents?: true

Size: 649 Bytes

Versions: 1

Compression:

Stored size: 649 Bytes

Contents

class CreateSidejobs < ActiveRecord::Migration
  def change
    create_table :sidejobs do |t|
      if ActiveRecord::Base.connection_config[:adapter] == 'postgresql'
        t.jsonb :data
      else
        t.string :data
      end
      t.string :queue
      t.string :status, default: 'pending'
      t.integer :priority, default: 0
      t.integer :attempts, default: 0
      t.text :error
      t.datetime :failed_at
      t.datetime :completed_at
      t.datetime :processed_at
      t.datetime :scheduled_at

      t.timestamps null: false
    end

    add_index :sidejobs, %i(status scheduled_at)
    add_index :sidejobs, :priority
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sidejobs-0.0.1 test/dummy/db/migrate/20161022211612_create_sidejobs.rb