diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-18 18:06:21 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-18 18:06:21 +0000 |
commit | 6d59e989185a7d2645792b713d1b5d95d46651fd (patch) | |
tree | f89d869a6c557a3e6e0b9305290259ab1d6fb589 /db | |
parent | 5c521d1f9b1e389e2f9b2b5fccf3798159a10f8d (diff) | |
download | gitlab-ce-6d59e989185a7d2645792b713d1b5d95d46651fd.tar.gz |
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.rb | 17 | ||||
-rw-r--r-- | db/migrate/20191014132931_remove_index_on_snippets_project_id.rb | 17 | ||||
-rw-r--r-- | db/schema.rb | 2 |
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" |