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

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

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

  def up
    with_lock_retries do
      remove_foreign_key_if_exists(:packages_build_infos, :ci_pipelines)
    end
  end

  def down
    add_concurrent_foreign_key(:packages_build_infos, :ci_pipelines, column: :pipeline_id, on_delete: :nullify)
  end
end