Sha256: efee3cd44fecc6ed27ccf611355ff6338e95fef06866749c346e9a919aa0fd42

Contents?: true

Size: 816 Bytes

Versions: 32

Compression:

Stored size: 816 Bytes

Contents

# frozen_string_literal: true
class IndexGoodJobJobsOnFinishedAt < ActiveRecord::Migration<%= migration_version %>
  disable_ddl_transaction!

  def change
    reversible do |dir|
      dir.up do
        # Ensure this incremental update migration is idempotent
        # with monolithic install migration.
        return if connection.index_name_exists?(:good_jobs, :index_good_jobs_on_active_job_id)
      end
    end

    add_index :good_jobs,
              [:active_job_id],
              name: :index_good_jobs_on_active_job_id,
              algorithm: :concurrently

    add_index :good_jobs,
              [:finished_at],
              where: "retried_good_job_id IS NULL AND finished_at IS NOT NULL",
              name: :index_good_jobs_jobs_on_finished_at,
              algorithm: :concurrently
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
good_job-2.99.0 lib/generators/good_job/templates/update/migrations/04_index_good_job_jobs_on_finished_at.rb.erb
good_job-2.17.1 lib/generators/good_job/templates/update/migrations/04_index_good_job_jobs_on_finished_at.rb.erb
good_job-2.17.0 lib/generators/good_job/templates/update/migrations/04_index_good_job_jobs_on_finished_at.rb.erb
good_job-2.16.1 lib/generators/good_job/templates/update/migrations/04_index_good_job_jobs_on_finished_at.rb.erb
good_job-2.16.0 lib/generators/good_job/templates/update/migrations/04_index_good_job_jobs_on_finished_at.rb.erb
good_job-2.15.2 lib/generators/good_job/templates/update/migrations/04_index_good_job_jobs_on_finished_at.rb.erb
good_job-2.15.1 lib/generators/good_job/templates/update/migrations/04_index_good_job_jobs_on_finished_at.rb.erb
good_job-2.15.0 lib/generators/good_job/templates/update/migrations/04_index_good_job_jobs_on_finished_at.rb.erb
good_job-2.14.4 lib/generators/good_job/templates/update/migrations/04_index_good_job_jobs_on_finished_at.rb.erb
good_job-2.14.3 lib/generators/good_job/templates/update/migrations/04_index_good_job_jobs_on_finished_at.rb.erb
good_job-2.14.2 lib/generators/good_job/templates/update/migrations/04_index_good_job_jobs_on_finished_at.rb.erb
good_job-2.14.1 lib/generators/good_job/templates/update/migrations/04_index_good_job_jobs_on_finished_at.rb.erb
good_job-2.14.0 lib/generators/good_job/templates/update/migrations/04_index_good_job_jobs_on_finished_at.rb.erb
good_job-2.13.2 lib/generators/good_job/templates/update/migrations/04_index_good_job_jobs_on_finished_at.rb.erb
good_job-2.13.1 lib/generators/good_job/templates/update/migrations/04_index_good_job_jobs_on_finished_at.rb.erb
good_job-2.13.0 lib/generators/good_job/templates/update/migrations/04_index_good_job_jobs_on_finished_at.rb.erb
good_job-2.12.2 lib/generators/good_job/templates/update/migrations/04_index_good_job_jobs_on_finished_at.rb.erb
good_job-2.12.1 lib/generators/good_job/templates/update/migrations/04_index_good_job_jobs_on_finished_at.rb.erb
good_job-2.12.0 lib/generators/good_job/templates/update/migrations/04_index_good_job_jobs_on_finished_at.rb.erb
good_job-2.11.3 lib/generators/good_job/templates/update/migrations/04_index_good_job_jobs_on_finished_at.rb.erb