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/post_migrate/20210824102624_add_project_namespace_index_to_project.rb')
-rw-r--r--db/post_migrate/20210824102624_add_project_namespace_index_to_project.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/db/post_migrate/20210824102624_add_project_namespace_index_to_project.rb b/db/post_migrate/20210824102624_add_project_namespace_index_to_project.rb
new file mode 100644
index 00000000000..d88a31fca7d
--- /dev/null
+++ b/db/post_migrate/20210824102624_add_project_namespace_index_to_project.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class AddProjectNamespaceIndexToProject < ActiveRecord::Migration[6.1]
+ include Gitlab::Database::MigrationHelpers
+
+ disable_ddl_transaction!
+
+ INDEX_NAME = 'index_projects_on_project_namespace_id'
+
+ def up
+ add_concurrent_index :projects, :project_namespace_id, name: INDEX_NAME, unique: true
+ end
+
+ def down
+ remove_concurrent_index_by_name :projects, INDEX_NAME
+ end
+end