20170305203726_add_owner_id_foreign_key.rb 336 Bytes
Newer Older
1
class AddOwnerIdForeignKey < ActiveRecord::Migration[4.2]
2 3 4 5 6 7
  include Gitlab::Database::MigrationHelpers

  DOWNTIME = false

  disable_ddl_transaction!

8
  def up
9 10
    add_concurrent_foreign_key :ci_triggers, :users, column: :owner_id, on_delete: :cascade
  end
11 12 13 14

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