Welcome to mirror list, hosted at ThFree Co, Russian Federation.

20231130193042_add_index_to_bulk_import_entities_on_updated_at_and_status.rb « post_migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 318dea4ef79cbdaedc6634c0fb686b573a703f8f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# frozen_string_literal: true

class AddIndexToBulkImportEntitiesOnUpdatedAtAndStatus < Gitlab::Database::Migration[2.2]
  milestone '16.7'
  disable_ddl_transaction!

  INDEX_NAME = 'index_bulk_import_entities_for_stale_status'

  def up
    add_concurrent_index :bulk_import_entities, [:updated_at, :id],
      where: 'status in (0, 1)', name: INDEX_NAME
  end

  def down
    remove_concurrent_index_by_name :bulk_import_entities, name: INDEX_NAME
  end
end