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

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

# See http://doc.gitlab.com/ce/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.

class IndexClustersKubernetesNamespacesOnClusterIdAndEnvironmentId < ActiveRecord::Migration[5.1]
  include Gitlab::Database::MigrationHelpers

  DOWNTIME = false
  INDEX_NAME = 'index_clusters_kubernetes_namespaces_on_cluster_and_environment'

  disable_ddl_transaction!

  def up
    add_concurrent_index :clusters_kubernetes_namespaces, [:cluster_id, :environment_id],
      unique: true, name: INDEX_NAME
  end

  def down
    remove_concurrent_index :clusters_kubernetes_namespaces, name: INDEX_NAME
  end
end