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

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

class RemoveClustersApplicationsPrometheusFk < Gitlab::Database::Migration[2.1]
  disable_ddl_transaction!

  def up
    with_lock_retries do
      remove_foreign_key_if_exists(:clusters_applications_prometheus, column: :cluster_id)
    end
  end

  def down
    add_concurrent_foreign_key :clusters_applications_prometheus, :clusters,
      column: :cluster_id, on_delete: :cascade, name: 'fk_557e773639'
  end
end