Sha256: ef92fbc4517a6ad62ce0f2e50395e04b4f1514d7990d45478dc31b2ffe1b5a16

Contents?: true

Size: 967 Bytes

Versions: 48

Compression:

Stored size: 967 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

48 entries across 48 versions & 1 rubygems

Version Path
good_job-3.17.2 lib/generators/good_job/templates/update/migrations/04_create_good_job_batches.rb.erb
good_job-3.17.1 lib/generators/good_job/templates/update/migrations/04_create_good_job_batches.rb.erb
good_job-3.17.0 lib/generators/good_job/templates/update/migrations/04_create_good_job_batches.rb.erb
good_job-3.16.4 lib/generators/good_job/templates/update/migrations/04_create_good_job_batches.rb.erb
good_job-3.16.3 lib/generators/good_job/templates/update/migrations/04_create_good_job_batches.rb.erb
good_job-3.16.2 lib/generators/good_job/templates/update/migrations/04_create_good_job_batches.rb.erb
good_job-3.16.1 lib/generators/good_job/templates/update/migrations/04_create_good_job_batches.rb.erb
good_job-3.16.0 lib/generators/good_job/templates/update/migrations/04_create_good_job_batches.rb.erb