diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-16 15:09:03 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-16 15:09:03 +0300 |
commit | 8215fc964a189ae5c876a10f2e7d61933a725e24 (patch) | |
tree | acdd0abd951ca0f392c7617821ab347d77c1a623 /db | |
parent | a57cec4bb89b61d210d4e413571b1d85d76179f6 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20210203222620_add_expired_index_to_composer_cache_files.rb | 19 | ||||
-rw-r--r-- | db/migrate/20210203223551_add_orphan_index_to_composer_cache_files.rb | 19 | ||||
-rw-r--r-- | db/schema_migrations/20210203222620 | 1 | ||||
-rw-r--r-- | db/schema_migrations/20210203223551 | 1 | ||||
-rw-r--r-- | db/structure.sql | 4 |
5 files changed, 44 insertions, 0 deletions
diff --git a/db/migrate/20210203222620_add_expired_index_to_composer_cache_files.rb b/db/migrate/20210203222620_add_expired_index_to_composer_cache_files.rb new file mode 100644 index 00000000000..9c6a27812a5 --- /dev/null +++ b/db/migrate/20210203222620_add_expired_index_to_composer_cache_files.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class AddExpiredIndexToComposerCacheFiles < ActiveRecord::Migration[6.0] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + disable_ddl_transaction! + + INDEX_NAME = 'composer_cache_files_index_on_deleted_at' + + def up + add_concurrent_index :packages_composer_cache_files, [:delete_at, :id], name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :packages_composer_cache_files, INDEX_NAME + end +end diff --git a/db/migrate/20210203223551_add_orphan_index_to_composer_cache_files.rb b/db/migrate/20210203223551_add_orphan_index_to_composer_cache_files.rb new file mode 100644 index 00000000000..e2853977e5f --- /dev/null +++ b/db/migrate/20210203223551_add_orphan_index_to_composer_cache_files.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class AddOrphanIndexToComposerCacheFiles < ActiveRecord::Migration[6.0] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + disable_ddl_transaction! + + INDEX_NAME = 'index_composer_cache_files_where_namespace_id_is_null' + + def up + add_concurrent_index :packages_composer_cache_files, :id, name: INDEX_NAME, where: 'namespace_id IS NULL' + end + + def down + remove_concurrent_index_by_name :packages_composer_cache_files, INDEX_NAME + end +end diff --git a/db/schema_migrations/20210203222620 b/db/schema_migrations/20210203222620 new file mode 100644 index 00000000000..2c8c3ffc111 --- /dev/null +++ b/db/schema_migrations/20210203222620 @@ -0,0 +1 @@ +6d3250533b72c6aa307570d386725fa3ebe1ec49c36edc0f7d6dc8a1d5092826
\ No newline at end of file diff --git a/db/schema_migrations/20210203223551 b/db/schema_migrations/20210203223551 new file mode 100644 index 00000000000..53b3a9f65aa --- /dev/null +++ b/db/schema_migrations/20210203223551 @@ -0,0 +1 @@ +4ccf450bbc9061edae81cabcfafd9360f1f57cfd25af3ad016fbbb344f9fe694
\ No newline at end of file diff --git a/db/structure.sql b/db/structure.sql index 5d27baaab02..386fbe4ee3f 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -21202,6 +21202,8 @@ CREATE INDEX code_owner_approval_required ON protected_branches USING btree (pro CREATE INDEX commit_id_and_note_id_index ON commit_user_mentions USING btree (commit_id, note_id); +CREATE INDEX composer_cache_files_index_on_deleted_at ON packages_composer_cache_files USING btree (delete_at, id); + CREATE UNIQUE INDEX design_management_designs_versions_uniqueness ON design_management_designs_versions USING btree (design_id, version_id); CREATE INDEX design_user_mentions_on_design_id_and_note_id_index ON design_user_mentions USING btree (design_id, note_id); @@ -21860,6 +21862,8 @@ CREATE INDEX index_clusters_on_user_id ON clusters USING btree (user_id); CREATE UNIQUE INDEX index_commit_user_mentions_on_note_id ON commit_user_mentions USING btree (note_id); +CREATE INDEX index_composer_cache_files_where_namespace_id_is_null ON packages_composer_cache_files USING btree (id) WHERE (namespace_id IS NULL); + CREATE INDEX index_container_expiration_policies_on_next_run_at_and_enabled ON container_expiration_policies USING btree (next_run_at, enabled); CREATE INDEX index_container_repositories_on_project_id ON container_repositories USING btree (project_id); |