diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-09-29 18:12:42 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-09-29 18:12:42 +0000 |
commit | fef5449973e2097fbedd92980d78dc4baf54afd6 (patch) | |
tree | fae2e4b1e9eb45e0e9b1da569721c5f8c1cea4ef /db | |
parent | cee701c9641a4dfa508f9a1d913863a52ae67167 (diff) | |
download | gitlab-ce-fef5449973e2097fbedd92980d78dc4baf54afd6.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
11 files changed, 96 insertions, 1 deletions
diff --git a/db/migrate/20210910014741_add_dependency_proxy_ttl_group_policy_worker_capacity_to_application_settings.rb b/db/migrate/20210910014741_add_dependency_proxy_ttl_group_policy_worker_capacity_to_application_settings.rb new file mode 100644 index 00000000000..52fab5a63ee --- /dev/null +++ b/db/migrate/20210910014741_add_dependency_proxy_ttl_group_policy_worker_capacity_to_application_settings.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +class AddDependencyProxyTtlGroupPolicyWorkerCapacityToApplicationSettings < Gitlab::Database::Migration[1.0] + def change + add_column :application_settings, + :dependency_proxy_ttl_group_policy_worker_capacity, + :smallint, + default: 2, + null: false + end +end diff --git a/db/migrate/20210910015047_add_app_settings_dep_proxy_ttl_worker_capacity_check_constraint.rb b/db/migrate/20210910015047_add_app_settings_dep_proxy_ttl_worker_capacity_check_constraint.rb new file mode 100644 index 00000000000..9b522f2874f --- /dev/null +++ b/db/migrate/20210910015047_add_app_settings_dep_proxy_ttl_worker_capacity_check_constraint.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddAppSettingsDepProxyTtlWorkerCapacityCheckConstraint < Gitlab::Database::Migration[1.0] + CONSTRAINT_NAME = 'app_settings_dep_proxy_ttl_policies_worker_capacity_positive' + + disable_ddl_transaction! + + def up + add_check_constraint :application_settings, 'dependency_proxy_ttl_group_policy_worker_capacity >= 0', CONSTRAINT_NAME + end + + def down + remove_check_constraint :application_settings, CONSTRAINT_NAME + end +end diff --git a/db/migrate/20210913224558_update_dependency_proxy_manifests_uniqueness_constraint.rb b/db/migrate/20210913224558_update_dependency_proxy_manifests_uniqueness_constraint.rb new file mode 100644 index 00000000000..845697c28b5 --- /dev/null +++ b/db/migrate/20210913224558_update_dependency_proxy_manifests_uniqueness_constraint.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class UpdateDependencyProxyManifestsUniquenessConstraint < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + NEW_INDEX_NAME = 'index_dep_prox_manifests_on_group_id_file_name_and_status' + OLD_INDEX_NAME = 'index_dependency_proxy_manifests_on_group_id_and_file_name' + + def up + add_concurrent_index :dependency_proxy_manifests, [:group_id, :file_name, :status], unique: true, name: NEW_INDEX_NAME + remove_concurrent_index_by_name :dependency_proxy_manifests, OLD_INDEX_NAME + end + + def down + add_concurrent_index :dependency_proxy_manifests, [:group_id, :file_name], unique: true, name: OLD_INDEX_NAME + remove_concurrent_index_by_name :dependency_proxy_manifests, NEW_INDEX_NAME + end +end diff --git a/db/migrate/20210914172202_add_status_index_to_dependency_proxy_tables.rb b/db/migrate/20210914172202_add_status_index_to_dependency_proxy_tables.rb new file mode 100644 index 00000000000..9b593fbe540 --- /dev/null +++ b/db/migrate/20210914172202_add_status_index_to_dependency_proxy_tables.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class AddStatusIndexToDependencyProxyTables < Gitlab::Database::Migration[1.0] + MANIFEST_INDEX_NAME = 'index_dependency_proxy_manifests_on_status' + BLOB_INDEX_NAME = 'index_dependency_proxy_blobs_on_status' + + disable_ddl_transaction! + + def up + add_concurrent_index :dependency_proxy_manifests, :status, name: MANIFEST_INDEX_NAME + add_concurrent_index :dependency_proxy_blobs, :status, name: BLOB_INDEX_NAME + end + + def down + remove_concurrent_index_by_name :dependency_proxy_manifests, MANIFEST_INDEX_NAME + remove_concurrent_index_by_name :dependency_proxy_blobs, BLOB_INDEX_NAME + end +end diff --git a/db/migrate/20210928171122_add_group_id_status_id_index_to_dependency_proxy_tables.rb b/db/migrate/20210928171122_add_group_id_status_id_index_to_dependency_proxy_tables.rb new file mode 100644 index 00000000000..ef437641f2c --- /dev/null +++ b/db/migrate/20210928171122_add_group_id_status_id_index_to_dependency_proxy_tables.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class AddGroupIdStatusIdIndexToDependencyProxyTables < Gitlab::Database::Migration[1.0] + MANIFEST_INDEX_NAME = 'index_dependency_proxy_manifests_on_group_id_status_and_id' + BLOB_INDEX_NAME = 'index_dependency_proxy_blobs_on_group_id_status_and_id' + + disable_ddl_transaction! + + def up + add_concurrent_index :dependency_proxy_manifests, [:group_id, :status, :id], name: MANIFEST_INDEX_NAME + add_concurrent_index :dependency_proxy_blobs, [:group_id, :status, :id], name: BLOB_INDEX_NAME + end + + def down + remove_concurrent_index_by_name :dependency_proxy_manifests, MANIFEST_INDEX_NAME + remove_concurrent_index_by_name :dependency_proxy_blobs, BLOB_INDEX_NAME + end +end diff --git a/db/schema_migrations/20210910014741 b/db/schema_migrations/20210910014741 new file mode 100644 index 00000000000..b0f32fcabf3 --- /dev/null +++ b/db/schema_migrations/20210910014741 @@ -0,0 +1 @@ +e6342d440d398980470f4dd018c5df56d0b5d4df11caa7ba5dd2e92578dbf678
\ No newline at end of file diff --git a/db/schema_migrations/20210910015047 b/db/schema_migrations/20210910015047 new file mode 100644 index 00000000000..3f76060a9bb --- /dev/null +++ b/db/schema_migrations/20210910015047 @@ -0,0 +1 @@ +d0b2ee97781a5d3c671b855fb6be844431a73584be47ba35d83c7e8cfec69bcb
\ No newline at end of file diff --git a/db/schema_migrations/20210913224558 b/db/schema_migrations/20210913224558 new file mode 100644 index 00000000000..f2fb4eaeb71 --- /dev/null +++ b/db/schema_migrations/20210913224558 @@ -0,0 +1 @@ +377af41414793d7e52ffbb1fd60f2f19c58cd63bb0e85192983b5bfe98515ae8
\ No newline at end of file diff --git a/db/schema_migrations/20210914172202 b/db/schema_migrations/20210914172202 new file mode 100644 index 00000000000..2f7531b98aa --- /dev/null +++ b/db/schema_migrations/20210914172202 @@ -0,0 +1 @@ +2ab67d4cc17d0fdf01b5861a46d6ec51d1e76e7e88209b0964a884edd22cc63d
\ No newline at end of file diff --git a/db/schema_migrations/20210928171122 b/db/schema_migrations/20210928171122 new file mode 100644 index 00000000000..ccddd09345b --- /dev/null +++ b/db/schema_migrations/20210928171122 @@ -0,0 +1 @@ +f257ff9896e2d90ced39c2c010df1d4b74badae046651a190585c9c47342d119
\ No newline at end of file diff --git a/db/structure.sql b/db/structure.sql index c30123db88b..80689a24f2a 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -10344,7 +10344,9 @@ CREATE TABLE application_settings ( throttle_authenticated_deprecated_api_requests_per_period integer DEFAULT 3600 NOT NULL, throttle_authenticated_deprecated_api_period_in_seconds integer DEFAULT 3600 NOT NULL, throttle_authenticated_deprecated_api_enabled boolean DEFAULT false NOT NULL, + dependency_proxy_ttl_group_policy_worker_capacity smallint DEFAULT 2 NOT NULL, CONSTRAINT app_settings_container_reg_cleanup_tags_max_list_size_positive CHECK ((container_registry_cleanup_tags_service_max_list_size >= 0)), + CONSTRAINT app_settings_dep_proxy_ttl_policies_worker_capacity_positive CHECK ((dependency_proxy_ttl_group_policy_worker_capacity >= 0)), CONSTRAINT app_settings_ext_pipeline_validation_service_url_text_limit CHECK ((char_length(external_pipeline_validation_service_url) <= 255)), CONSTRAINT app_settings_registry_exp_policies_worker_capacity_positive CHECK ((container_registry_expiration_policies_worker_capacity >= 0)), CONSTRAINT app_settings_yaml_max_depth_positive CHECK ((max_yaml_depth > 0)), @@ -24835,11 +24837,19 @@ CREATE INDEX index_dep_ci_build_trace_sections_on_project_id ON dep_ci_build_tra CREATE INDEX index_dep_ci_build_trace_sections_on_section_name_id ON dep_ci_build_trace_sections USING btree (section_name_id); +CREATE UNIQUE INDEX index_dep_prox_manifests_on_group_id_file_name_and_status ON dependency_proxy_manifests USING btree (group_id, file_name, status); + CREATE INDEX index_dependency_proxy_blobs_on_group_id_and_file_name ON dependency_proxy_blobs USING btree (group_id, file_name); +CREATE INDEX index_dependency_proxy_blobs_on_group_id_status_and_id ON dependency_proxy_blobs USING btree (group_id, status, id); + +CREATE INDEX index_dependency_proxy_blobs_on_status ON dependency_proxy_blobs USING btree (status); + CREATE INDEX index_dependency_proxy_group_settings_on_group_id ON dependency_proxy_group_settings USING btree (group_id); -CREATE UNIQUE INDEX index_dependency_proxy_manifests_on_group_id_and_file_name ON dependency_proxy_manifests USING btree (group_id, file_name); +CREATE INDEX index_dependency_proxy_manifests_on_group_id_status_and_id ON dependency_proxy_manifests USING btree (group_id, status, id); + +CREATE INDEX index_dependency_proxy_manifests_on_status ON dependency_proxy_manifests USING btree (status); CREATE INDEX index_deploy_key_id_on_protected_branch_push_access_levels ON protected_branch_push_access_levels USING btree (deploy_key_id); |