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:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-09-07 12:11:43 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-09-07 12:11:43 +0300
commit378308b6cde44eb1a320b9202ff8946a911f35f6 (patch)
tree3031a645455dbbcdb2961dd09c15100fa28ed8e1 /db/migrate/20210901065504_add_index_on_name_and_id_to_public_groups.rb
parent777dc3053f8433a9f5c9cc868325e16eac5d93e5 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db/migrate/20210901065504_add_index_on_name_and_id_to_public_groups.rb')
-rw-r--r--db/migrate/20210901065504_add_index_on_name_and_id_to_public_groups.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/db/migrate/20210901065504_add_index_on_name_and_id_to_public_groups.rb b/db/migrate/20210901065504_add_index_on_name_and_id_to_public_groups.rb
new file mode 100644
index 00000000000..77b9e5297a7
--- /dev/null
+++ b/db/migrate/20210901065504_add_index_on_name_and_id_to_public_groups.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class AddIndexOnNameAndIdToPublicGroups < Gitlab::Database::Migration[1.0]
+ INDEX_NAME = 'index_namespaces_public_groups_name_id'
+ PUBLIC_VISIBILITY_LEVEL = 20
+
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_index :namespaces, [:name, :id], name: INDEX_NAME,
+ where: "type = 'Group' AND visibility_level = #{PUBLIC_VISIBILITY_LEVEL}"
+ end
+
+ def down
+ remove_concurrent_index_by_name :namespaces, INDEX_NAME
+ end
+end