blob: 43b4db7d9b565d1a166d0c14faabb3d8b9f67be6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
# frozen_string_literal: true
# See https://docs.gitlab.com/ee/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.
class AddIssueSearchDataNamespaceIdForeignKey < Gitlab::Database::Migration[2.1]
include Gitlab::Database::PartitioningMigrationHelpers
disable_ddl_transaction!
INDEX_NAME = 'index_issue_search_data_on_namespace_id'
def up
add_concurrent_partitioned_index :issue_search_data, :namespace_id, name: INDEX_NAME
add_concurrent_partitioned_foreign_key :issue_search_data, :namespaces,
column: :namespace_id,
on_delete: :cascade
end
def down
remove_foreign_key_if_exists :issue_search_data, column: :namespace_id
remove_concurrent_partitioned_index_by_name :issue_search_data, INDEX_NAME
end
end
|