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

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

class AddForeignKeyToCiPipelinesExternalPullRequest < ActiveRecord::Migration[5.2]
  include Gitlab::Database::MigrationHelpers

  DOWNTIME = false

  disable_ddl_transaction!

  def up
    add_concurrent_foreign_key :ci_pipelines, :external_pull_requests, column: :external_pull_request_id, on_delete: :nullify
  end

  def down
    remove_foreign_key :ci_pipelines, :external_pull_requests
  end
end