diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-16 18:13:28 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-16 18:13:28 +0300 |
commit | 3563f193744bf8bca9a1099fe6f6399c8883ec7e (patch) | |
tree | a14b71b59036f1c401bbfe4340f364fbf3a73ed9 /db | |
parent | dc9ff5fda1337883acd09fd4b98be2f6a41ad037 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r-- | db/post_migrate/20211115151704_add_index_on_projects_import_type_id.rb | 15 | ||||
-rw-r--r-- | db/schema_migrations/20211115151704 | 1 | ||||
-rw-r--r-- | db/structure.sql | 2 |
3 files changed, 18 insertions, 0 deletions
diff --git a/db/post_migrate/20211115151704_add_index_on_projects_import_type_id.rb b/db/post_migrate/20211115151704_add_index_on_projects_import_type_id.rb new file mode 100644 index 00000000000..b54edc1cf73 --- /dev/null +++ b/db/post_migrate/20211115151704_add_index_on_projects_import_type_id.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddIndexOnProjectsImportTypeId < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + INDEX_NAME = 'index_imported_projects_on_import_type_id' + + def up + add_concurrent_index(:projects, [:import_type, :id], where: 'import_type IS NOT NULL', name: INDEX_NAME) + end + + def down + remove_concurrent_index_by_name(:projects, INDEX_NAME) + end +end diff --git a/db/schema_migrations/20211115151704 b/db/schema_migrations/20211115151704 new file mode 100644 index 00000000000..03093ade126 --- /dev/null +++ b/db/schema_migrations/20211115151704 @@ -0,0 +1 @@ +3db18116febc760bcfeab597e0508d5b2835d0135068d79073770d343aa4b09c
\ No newline at end of file diff --git a/db/structure.sql b/db/structure.sql index 5b6614be454..c5d619cb2a3 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -26064,6 +26064,8 @@ CREATE INDEX index_import_failures_on_project_id_not_null ON import_failures USI CREATE INDEX index_imported_projects_on_import_type_creator_id_created_at ON projects USING btree (import_type, creator_id, created_at) WHERE (import_type IS NOT NULL); +CREATE INDEX index_imported_projects_on_import_type_id ON projects USING btree (import_type, id) WHERE (import_type IS NOT NULL); + CREATE INDEX index_in_product_marketing_emails_on_user_id ON in_product_marketing_emails USING btree (user_id); CREATE UNIQUE INDEX index_in_product_marketing_emails_on_user_track_series ON in_product_marketing_emails USING btree (user_id, track, series); |