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: 00d0b0f2c7f862f6540e4d743a252867627e1e22 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
class AddForeignKeyToIssueAuthor < ActiveRecord::Migration[4.2]
  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