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
path: root/db
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-11-26 15:09:48 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-11-26 15:09:48 +0300
commit142890d5bbefa7b1e1b30f263f9ad67d9d496d29 (patch)
tree2c4de4059aba586f3204f983f17757dbf1643b6c /db
parentbbede1e22c4dd615042a3e9c0d7e24afc83ca377 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20201117184334_add_index_to_project_repositories_shard_id_project_id.rb17
-rw-r--r--db/schema_migrations/202011171843341
-rw-r--r--db/structure.sql2
3 files changed, 20 insertions, 0 deletions
diff --git a/db/migrate/20201117184334_add_index_to_project_repositories_shard_id_project_id.rb b/db/migrate/20201117184334_add_index_to_project_repositories_shard_id_project_id.rb
new file mode 100644
index 00000000000..25d95231ac4
--- /dev/null
+++ b/db/migrate/20201117184334_add_index_to_project_repositories_shard_id_project_id.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class AddIndexToProjectRepositoriesShardIdProjectId < ActiveRecord::Migration[6.0]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_index :project_repositories, [:shard_id, :project_id]
+ end
+
+ def down
+ remove_concurrent_index :project_repositories, [:shard_id, :project_id], name: 'index_project_repositories_on_shard_id_and_project_id'
+ end
+end
diff --git a/db/schema_migrations/20201117184334 b/db/schema_migrations/20201117184334
new file mode 100644
index 00000000000..347d6ca087c
--- /dev/null
+++ b/db/schema_migrations/20201117184334
@@ -0,0 +1 @@
+7988d01be5fac0f2a28cc97e309bfa16450d2e376888401fc2ad521aa0082020 \ No newline at end of file
diff --git a/db/structure.sql b/db/structure.sql
index 95d85ad2e57..54888195975 100644
--- a/db/structure.sql
+++ b/db/structure.sql
@@ -21771,6 +21771,8 @@ CREATE UNIQUE INDEX index_project_repositories_on_project_id ON project_reposito
CREATE INDEX index_project_repositories_on_shard_id ON project_repositories USING btree (shard_id);
+CREATE INDEX index_project_repositories_on_shard_id_and_project_id ON project_repositories USING btree (shard_id, project_id);
+
CREATE UNIQUE INDEX index_project_repository_states_on_project_id ON project_repository_states USING btree (project_id);
CREATE INDEX index_project_repository_storage_moves_on_project_id ON project_repository_storage_moves USING btree (project_id);