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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'db/migrate/20220503073401_recreate_index_for_group_group_link_with_both_group_ids.rb')
-rw-r--r--db/migrate/20220503073401_recreate_index_for_group_group_link_with_both_group_ids.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/db/migrate/20220503073401_recreate_index_for_group_group_link_with_both_group_ids.rb b/db/migrate/20220503073401_recreate_index_for_group_group_link_with_both_group_ids.rb
new file mode 100644
index 00000000000..214e9c5e0a7
--- /dev/null
+++ b/db/migrate/20220503073401_recreate_index_for_group_group_link_with_both_group_ids.rb
@@ -0,0 +1,18 @@
+# frozen_string_literal: true
+
+class RecreateIndexForGroupGroupLinkWithBothGroupIds < Gitlab::Database::Migration[2.0]
+ disable_ddl_transaction!
+
+ OLD_INDEX_NAME = 'index_group_group_links_on_shared_with_group_id'
+ NEW_INDEX_NAME = 'index_group_group_links_on_shared_with_group_and_shared_group'
+
+ def up
+ add_concurrent_index :group_group_links, [:shared_with_group_id, :shared_group_id], name: NEW_INDEX_NAME
+ remove_concurrent_index_by_name :group_group_links, OLD_INDEX_NAME
+ end
+
+ def down
+ add_concurrent_index :group_group_links, [:shared_with_group_id], name: OLD_INDEX_NAME
+ remove_concurrent_index_by_name :group_group_links, NEW_INDEX_NAME
+ end
+end