summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2017-09-22 11:24:50 +0000
committerDouwe Maan <douwe@gitlab.com>2017-09-22 11:24:50 +0000
commitd426b6bcc674d1dd8c8e0d45bb2e032f6fa94ea4 (patch)
tree9dd18e55897ab8d1cf22e73dd291575dc166fdcf
parentc01bd64f56d2df6569614cb0bc5844df1be0368d (diff)
parent3ce81ec67e89f612283e20c6077dba24abb33e26 (diff)
downloadgitlab-ce-d426b6bcc674d1dd8c8e0d45bb2e032f6fa94ea4.tar.gz
Merge branch 'ee-add-project-repository-storages-index' into 'master'
Index projects on repository storage See merge request gitlab-org/gitlab-ce!14414
-rw-r--r--changelogs/unreleased/ee-add-project-repository-storages-index.yml5
-rw-r--r--db/migrate/20170921115009_add_project_repository_storage_index.rb19
-rw-r--r--db/schema.rb3
3 files changed, 26 insertions, 1 deletions
diff --git a/changelogs/unreleased/ee-add-project-repository-storages-index.yml b/changelogs/unreleased/ee-add-project-repository-storages-index.yml
new file mode 100644
index 00000000000..8a144783cec
--- /dev/null
+++ b/changelogs/unreleased/ee-add-project-repository-storages-index.yml
@@ -0,0 +1,5 @@
+---
+title: Index projects on repository storage
+merge_request: 14414
+author:
+type: other
diff --git a/db/migrate/20170921115009_add_project_repository_storage_index.rb b/db/migrate/20170921115009_add_project_repository_storage_index.rb
new file mode 100644
index 00000000000..1c5a8fd65e1
--- /dev/null
+++ b/db/migrate/20170921115009_add_project_repository_storage_index.rb
@@ -0,0 +1,19 @@
+class AddProjectRepositoryStorageIndex < ActiveRecord::Migration
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_index(*index_spec) unless index_exists?(*index_spec)
+ end
+
+ def down
+ remove_concurrent_index(*index_spec) if index_exists?(*index_spec)
+ end
+
+ def index_spec
+ [:projects, :repository_storage]
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 3ec430c0078..80ef91ec95d 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema.define(version: 20170918223303) do
+ActiveRecord::Schema.define(version: 20170921115009) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@@ -1230,6 +1230,7 @@ ActiveRecord::Schema.define(version: 20170918223303) do
add_index "projects", ["path"], name: "index_projects_on_path", using: :btree
add_index "projects", ["path"], name: "index_projects_on_path_trigram", using: :gin, opclasses: {"path"=>"gin_trgm_ops"}
add_index "projects", ["pending_delete"], name: "index_projects_on_pending_delete", using: :btree
+ add_index "projects", ["repository_storage"], name: "index_projects_on_repository_storage", using: :btree
add_index "projects", ["runners_token"], name: "index_projects_on_runners_token", using: :btree
add_index "projects", ["star_count"], name: "index_projects_on_star_count", using: :btree
add_index "projects", ["visibility_level"], name: "index_projects_on_visibility_level", using: :btree