summaryrefslogtreecommitdiff
path: root/db/post_migrate/20211201101541_drop_clusters_applications_runners_ci_runners_fk.rb
blob: 9a02f64e3505e0f59fdc0aa296a2124dd9e7d6b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# frozen_string_literal: true

class DropClustersApplicationsRunnersCiRunnersFk < Gitlab::Database::Migration[1.0]
  disable_ddl_transaction!

  def up
    with_lock_retries do
      remove_foreign_key_if_exists(:clusters_applications_runners, :ci_runners, name: 'fk_02de2ded36')
    end
  end

  def down
    add_concurrent_foreign_key(:clusters_applications_runners, :ci_runners, name: 'fk_02de2ded36', column: :runner_id, target_column: :id, on_delete: 'set null')
  end
end