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

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

class AddTemporaryIndexForBackfillIntegrationsEnableSslVerification < Gitlab::Database::Migration[2.0]
  disable_ddl_transaction!

  INDEX_NAME = 'tmp_index_integrations_on_id_where_type_droneci_or_teamcity'
  INDEX_CONDITION = "type_new IN ('Integrations::DroneCi', 'Integrations::Teamcity') " \
    "AND encrypted_properties IS NOT NULL"

  def up
    # this index is used in 20220209121435_backfill_integrations_enable_ssl_verification
    add_concurrent_index :integrations, :id, where: INDEX_CONDITION, name: INDEX_NAME
  end

  def down
    remove_concurrent_index_by_name :integrations, INDEX_NAME
  end
end