summaryrefslogtreecommitdiff
path: root/db/migrate/20221225010106_create_remote_development_agent_config_agent_foreign_key.rb
blob: b861f41716847824f541bb4716d7f2a89bf0397f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# frozen_string_literal: true

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

  def up
    add_concurrent_foreign_key :remote_development_agent_configs,
      :cluster_agents, column: :cluster_agent_id, on_delete: :cascade
  end

  def down
    with_lock_retries do
      remove_foreign_key :remote_development_agent_configs, column: :cluster_agent_id
    end
  end
end