blob: a0a5f361edf0346894b3316582a9e36ab7bdc7ad (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
# frozen_string_literal: true
class AddIndexInheritFromIdToServices < ActiveRecord::Migration[6.0]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
def up
add_concurrent_index :services, :inherit_from_id
add_concurrent_foreign_key :services, :services, column: :inherit_from_id, on_delete: :nullify
end
def down
remove_foreign_key_if_exists :services, column: :inherit_from_id
remove_concurrent_index :services, :inherit_from_id
end
end
|