Sha256: d6653f28c3a37d652bb900cd8bd55976ef2c07afabd36b26e1ba8221647b6d66

Contents?: true

Size: 664 Bytes

Versions: 22

Compression:

Stored size: 664 Bytes

Contents

# frozen_string_literal: true

class CreateGoodJobLabelsIndex < ActiveRecord::Migration<%= migration_version %>
  disable_ddl_transaction!

  def change
    reversible do |dir|
      dir.up do
        unless connection.index_name_exists?(:good_jobs, :index_good_jobs_on_labels)
          add_index :good_jobs, :labels, using: :gin, where: "(labels IS NOT NULL)",
            name: :index_good_jobs_on_labels, algorithm: :concurrently
        end
      end

      dir.down do
        if connection.index_name_exists?(:good_jobs, :index_good_jobs_on_labels)
          remove_index :good_jobs, name: :index_good_jobs_on_labels
        end
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
good_job-3.99.1 lib/generators/good_job/templates/update/migrations/09_create_good_job_labels_index.rb.erb
good_job-3.99.0 lib/generators/good_job/templates/update/migrations/09_create_good_job_labels_index.rb.erb
good_job-3.30.1 lib/generators/good_job/templates/update/migrations/09_create_good_job_labels_index.rb.erb
good_job-3.30.0 lib/generators/good_job/templates/update/migrations/09_create_good_job_labels_index.rb.erb
good_job-3.29.5 lib/generators/good_job/templates/update/migrations/09_create_good_job_labels_index.rb.erb
good_job-3.29.4 lib/generators/good_job/templates/update/migrations/09_create_good_job_labels_index.rb.erb
good_job-3.29.3 lib/generators/good_job/templates/update/migrations/09_create_good_job_labels_index.rb.erb
good_job-3.28.2 lib/generators/good_job/templates/update/migrations/09_create_good_job_labels_index.rb.erb
good_job-3.28.1 lib/generators/good_job/templates/update/migrations/09_create_good_job_labels_index.rb.erb
good_job-3.28.0 lib/generators/good_job/templates/update/migrations/09_create_good_job_labels_index.rb.erb
good_job-3.27.4 lib/generators/good_job/templates/update/migrations/09_create_good_job_labels_index.rb.erb
good_job-3.27.3 lib/generators/good_job/templates/update/migrations/09_create_good_job_labels_index.rb.erb
good_job-3.27.2 lib/generators/good_job/templates/update/migrations/09_create_good_job_labels_index.rb.erb
good_job-3.27.1 lib/generators/good_job/templates/update/migrations/09_create_good_job_labels_index.rb.erb
good_job-3.27.0 lib/generators/good_job/templates/update/migrations/09_create_good_job_labels_index.rb.erb
good_job-3.26.2 lib/generators/good_job/templates/update/migrations/09_create_good_job_labels_index.rb.erb
good_job-3.26.1 lib/generators/good_job/templates/update/migrations/09_create_good_job_labels_index.rb.erb
good_job-3.26.0 lib/generators/good_job/templates/update/migrations/09_create_good_job_labels_index.rb.erb
good_job-3.25.0 lib/generators/good_job/templates/update/migrations/09_create_good_job_labels_index.rb.erb
good_job-3.24.0 lib/generators/good_job/templates/update/migrations/09_create_good_job_labels_index.rb.erb