Sha256: 23aa72e99fb51405957144cd5627a8b07db47c86335619be5276961a35def495

Contents?: true

Size: 540 Bytes

Versions: 4

Compression:

Stored size: 540 Bytes

Contents

class CreateSidejobs < ActiveRecord::Migration
  def change
    create_table :sidejobs do |t|
      t.jsonb :data
      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 attempts)
    add_index :sidejobs, :priority
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
sidejobs-5.1.0 lib/generators/sidejobs/install/templates/migration.rb
sidejobs-4.0.0.2 lib/generators/sidejobs/install/templates/migration.rb
sidejobs-4.0.0.1 lib/generators/sidejobs/install/templates/migration.rb
sidejobs-4.0.0.0 lib/generators/sidejobs/install/templates/migration.rb