Sha256: 7503c1aad814e0fe7ae6b79f8b31f576b566f8280bb626b1b6c6ab466c7b2b8a

Contents?: true

Size: 890 Bytes

Versions: 1

Compression:

Stored size: 890 Bytes

Contents

class CreateAsyncActiveJobs < ActiveRecord::Migration<%= migration_version %>
  def up
    create_table :async_active_jobs do |t|
      t.string :queue_name
      t.integer :priority, limit: 2, default: 0, null: false
      t.integer :attempts, limit: 2, default: 0, null: false
      t.json :job_data, null: false
      t.text :last_error
      t.timestamp :run_at
      t.timestamp :locked_at
      t.string :locked_by
      t.timestamp :failed_at
      t.timestamps null: false
    end

    add_index :async_active_jobs, :priority, name: 'async_active_jobs_priority_idx'
    add_index :async_active_jobs, :run_at, name: 'async_active_jobs_run_at_idx'
    add_index :async_active_jobs, :locked_at, name: 'async_active_jobs_locked_at_idx'
    add_index :async_active_jobs, :queue_name, name: 'async_active_jobs_queue_name_idx'
  end

  def down
    drop_table :async_active_jobs
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
async_active_job-0.1.0 lib/generators/async_active_job/templates/migration.rb.erb