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>2019-10-18 21:06:21 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2019-10-18 21:06:21 +0300
commit6d59e989185a7d2645792b713d1b5d95d46651fd (patch)
treef89d869a6c557a3e6e0b9305290259ab1d6fb589 /db
parent5c521d1f9b1e389e2f9b2b5fccf3798159a10f8d (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20191014084150_add_index_on_snippets_project_id_and_visibility_level.rb17
-rw-r--r--db/migrate/20191014132931_remove_index_on_snippets_project_id.rb17
-rw-r--r--db/schema.rb2
3 files changed, 35 insertions, 1 deletions
diff --git a/db/migrate/20191014084150_add_index_on_snippets_project_id_and_visibility_level.rb b/db/migrate/20191014084150_add_index_on_snippets_project_id_and_visibility_level.rb
new file mode 100644
index 00000000000..a8f40953e5d
--- /dev/null
+++ b/db/migrate/20191014084150_add_index_on_snippets_project_id_and_visibility_level.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class AddIndexOnSnippetsProjectIdAndVisibilityLevel < ActiveRecord::Migration[5.2]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_index :snippets, [:project_id, :visibility_level]
+ end
+
+ def down
+ remove_concurrent_index :snippets, [:project_id, :visibility_level]
+ end
+end
diff --git a/db/migrate/20191014132931_remove_index_on_snippets_project_id.rb b/db/migrate/20191014132931_remove_index_on_snippets_project_id.rb
new file mode 100644
index 00000000000..a1d3ffdb8c8
--- /dev/null
+++ b/db/migrate/20191014132931_remove_index_on_snippets_project_id.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class RemoveIndexOnSnippetsProjectId < ActiveRecord::Migration[5.2]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ disable_ddl_transaction!
+
+ def up
+ remove_concurrent_index :snippets, [:project_id]
+ end
+
+ def down
+ add_concurrent_index :snippets, [:project_id]
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index ef9cd696db5..b39eb408b0a 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -3449,7 +3449,7 @@ ActiveRecord::Schema.define(version: 2019_10_16_220135) do
t.index ["author_id"], name: "index_snippets_on_author_id"
t.index ["content"], name: "index_snippets_on_content_trigram", opclass: :gin_trgm_ops, using: :gin
t.index ["file_name"], name: "index_snippets_on_file_name_trigram", opclass: :gin_trgm_ops, using: :gin
- t.index ["project_id"], name: "index_snippets_on_project_id"
+ t.index ["project_id", "visibility_level"], name: "index_snippets_on_project_id_and_visibility_level"
t.index ["title"], name: "index_snippets_on_title_trigram", opclass: :gin_trgm_ops, using: :gin
t.index ["updated_at"], name: "index_snippets_on_updated_at"
t.index ["visibility_level"], name: "index_snippets_on_visibility_level"