Sha256: 434d69988d5813578f80f76df8dfe0c8a969f9e2bc43e88bdf91b2476971ae28

Contents?: true

Size: 966 Bytes

Versions: 32

Compression:

Stored size: 966 Bytes

Contents

# frozen_string_literal: true
class CreateGoodJobBatches < ActiveRecord::Migration<%= migration_version %>
  def change
    reversible do |dir|
      dir.up do
        # Ensure this incremental update migration is idempotent
        # with monolithic install migration.
        return if connection.table_exists?(:good_job_batches)
      end
    end

    create_table :good_job_batches, id: :uuid do |t|
      t.timestamps
      t.text :description
      t.jsonb :serialized_properties
      t.text :on_finish
      t.text :on_success
      t.text :on_discard
      t.text :callback_queue_name
      t.integer :callback_priority
      t.datetime :enqueued_at
      t.datetime :discarded_at
      t.datetime :finished_at
    end

    change_table :good_jobs do |t|
      t.uuid :batch_id
      t.uuid :batch_callback_id

      t.index :batch_id, where: "batch_id IS NOT NULL"
      t.index :batch_callback_id, where: "batch_callback_id IS NOT NULL"
    end
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
good_job-3.15.14 lib/generators/good_job/templates/update/migrations/04_create_good_job_batches.rb.erb
good_job-3.15.13 lib/generators/good_job/templates/update/migrations/04_create_good_job_batches.rb.erb
good_job-3.15.12 lib/generators/good_job/templates/update/migrations/04_create_good_job_batches.rb.erb
good_job-3.15.11 lib/generators/good_job/templates/update/migrations/04_create_good_job_batches.rb.erb
good_job-3.15.10 lib/generators/good_job/templates/update/migrations/04_create_good_job_batches.rb.erb
good_job-3.15.9 lib/generators/good_job/templates/update/migrations/04_create_good_job_batches.rb.erb
good_job-3.15.8 lib/generators/good_job/templates/update/migrations/04_create_good_job_batches.rb.erb
good_job-3.15.7 lib/generators/good_job/templates/update/migrations/04_create_good_job_batches.rb.erb
good_job-3.15.6 lib/generators/good_job/templates/update/migrations/04_create_good_job_batches.rb.erb
good_job-3.15.5 lib/generators/good_job/templates/update/migrations/04_create_good_job_batches.rb.erb
good_job-3.15.4 lib/generators/good_job/templates/update/migrations/04_create_good_job_batches.rb.erb
good_job-3.15.3 lib/generators/good_job/templates/update/migrations/04_create_good_job_batches.rb.erb
good_job-3.15.2 lib/generators/good_job/templates/update/migrations/04_create_good_job_batches.rb.erb
good_job-3.15.1 lib/generators/good_job/templates/update/migrations/04_create_good_job_batches.rb.erb
good_job-3.15.0 lib/generators/good_job/templates/update/migrations/04_create_good_job_batches.rb.erb
good_job-3.14.2 lib/generators/good_job/templates/update/migrations/04_create_good_job_batches.rb.erb
good_job-3.14.1 lib/generators/good_job/templates/update/migrations/04_create_good_job_batches.rb.erb
good_job-3.14.0 lib/generators/good_job/templates/update/migrations/04_create_good_job_batches.rb.erb
good_job-3.13.0 lib/generators/good_job/templates/update/migrations/04_create_good_job_batches.rb.erb
good_job-3.12.8 lib/generators/good_job/templates/update/migrations/04_create_good_job_batches.rb.erb