diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-24 03:09:28 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-24 03:09:28 +0000 |
commit | be2f4c5788975597dd7be1c8a3525549770c1216 (patch) | |
tree | 083ed0d7e29e26d479c00e00d9cb89d74ebbb0ef /db | |
parent | 2711c26beaca6c3a5a3be4b65e01557faf0185b6 (diff) | |
download | gitlab-ce-be2f4c5788975597dd7be1c8a3525549770c1216.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20200318175008_add_index_on_id_and_archived_and_pending_delete_to_projects.rb | 18 | ||||
-rw-r--r-- | db/structure.sql | 3 |
2 files changed, 21 insertions, 0 deletions
diff --git a/db/migrate/20200318175008_add_index_on_id_and_archived_and_pending_delete_to_projects.rb b/db/migrate/20200318175008_add_index_on_id_and_archived_and_pending_delete_to_projects.rb new file mode 100644 index 00000000000..9dba8537764 --- /dev/null +++ b/db/migrate/20200318175008_add_index_on_id_and_archived_and_pending_delete_to_projects.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class AddIndexOnIdAndArchivedAndPendingDeleteToProjects < ActiveRecord::Migration[6.0] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + INDEX_NAME = 'index_projects_on_id_and_archived_and_pending_delete' + + disable_ddl_transaction! + + def up + add_concurrent_index :projects, :id, where: "archived = FALSE AND pending_delete = FALSE", name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :projects, INDEX_NAME + end +end diff --git a/db/structure.sql b/db/structure.sql index e5d28e499f9..086f2bba6d1 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -9627,6 +9627,8 @@ CREATE INDEX index_projects_on_creator_id_and_created_at ON public.projects USIN CREATE INDEX index_projects_on_description_trigram ON public.projects USING gin (description public.gin_trgm_ops); +CREATE INDEX index_projects_on_id_and_archived_and_pending_delete ON public.projects USING btree (id) WHERE ((archived = false) AND (pending_delete = false)); + CREATE UNIQUE INDEX index_projects_on_id_partial_for_visibility ON public.projects USING btree (id) WHERE (visibility_level = ANY (ARRAY[10, 20])); CREATE INDEX index_projects_on_id_service_desk_enabled ON public.projects USING btree (id) WHERE (service_desk_enabled = true); @@ -12710,6 +12712,7 @@ INSERT INTO "schema_migrations" (version) VALUES ('20200318163148'), ('20200318164448'), ('20200318165448'), +('20200318175008'), ('20200319203901'), ('20200323075043'); |