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

20231124213241_add_index_to_bulk_imports_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: c3e657a4873a4733247a3b8180ffcae37533818a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# frozen_string_literal: true

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

  INDEX_NAME = 'index_bulk_imports_on_updated_at_and_id_for_stale_status'

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

  def down
    remove_concurrent_index_by_name :bulk_imports, name: INDEX_NAME
  end
end