summaryrefslogtreecommitdiff
path: root/db/migrate/20200925194006_add_project_foreign_key_to_bulk_import_entities.rb
blob: 975f2b1ef4a000797dbbe31eb3496405d0c5e7a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# frozen_string_literal: true

class AddProjectForeignKeyToBulkImportEntities < ActiveRecord::Migration[6.0]
  include Gitlab::Database::MigrationHelpers

  DOWNTIME = false

  disable_ddl_transaction!

  def up
    add_concurrent_foreign_key :bulk_import_entities, :projects, column: :project_id
  end

  def down
    with_lock_retries do
      remove_foreign_key :bulk_import_entities, column: :project_id
    end
  end
end