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

20170901071411_add_foreign_key_to_issue_author.rb « migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: ab6e9fb565af9049e5c1a21c6e98feaf69bd41d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
class AddForeignKeyToIssueAuthor < ActiveRecord::Migration
  include Gitlab::Database::MigrationHelpers

  DOWNTIME = false
  disable_ddl_transaction!

  def up
    add_concurrent_foreign_key(:issues, :users, column: :author_id, on_delete: :nullify)
  end

  def down
    remove_foreign_key(:issues, column: :author_id)
  end
end