summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorNick Thomas <nick@gitlab.com>2017-09-21 13:09:58 +0100
committerNick Thomas <nick@gitlab.com>2017-09-21 13:29:25 +0100
commit3ce81ec67e89f612283e20c6077dba24abb33e26 (patch)
tree7c7a18a60397c5b8872d9326e092902e8113df5b /db
parentcfccb2785fb8b98a013170aae4b931e9431739d1 (diff)
downloadgitlab-ce-3ce81ec67e89f612283e20c6077dba24abb33e26.tar.gz
Index projects on repository storage
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20170921115009_add_project_repository_storage_index.rb19
-rw-r--r--db/schema.rb3
2 files changed, 21 insertions, 1 deletions
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