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

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

class AddIndexOnEnabledAndProviderTypeAndIdToClusters < ActiveRecord::Migration[6.0]
  include Gitlab::Database::MigrationHelpers

  DOWNTIME = false

  disable_ddl_transaction!

  def up
    add_concurrent_index :clusters, [:enabled, :provider_type, :id]
    remove_concurrent_index :clusters, :enabled
  end

  def down
    add_concurrent_index :clusters, :enabled
    remove_concurrent_index :clusters, [:enabled, :provider_type, :id]
  end
end