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

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

  DOWNTIME = false

  disable_ddl_transaction!

  def up
    add_concurrent_foreign_key :ci_triggers, :users, column: :owner_id, on_delete: :cascade
  end

  def down
    remove_foreign_key :ci_triggers, column: :owner_id
  end
end