diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-08 21:07:53 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-08 21:07:53 +0300 |
commit | a3487798aeff89daff78749e6d6f392d3ca23687 (patch) | |
tree | fe7695c195931ee803aa862fc2bf977853b18a87 /db | |
parent | c6c5dd8848b78528d7ad7f044a0c95be629d372e (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
11 files changed, 95 insertions, 0 deletions
diff --git a/db/migrate/20230127121107_add_git_rate_limit_users_alertlist_to_application_settings.rb b/db/migrate/20230127121107_add_git_rate_limit_users_alertlist_to_application_settings.rb new file mode 100644 index 00000000000..b429bea1600 --- /dev/null +++ b/db/migrate/20230127121107_add_git_rate_limit_users_alertlist_to_application_settings.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +class AddGitRateLimitUsersAlertlistToApplicationSettings < Gitlab::Database::Migration[2.1] + def change + add_column :application_settings, :git_rate_limit_users_alertlist, + :integer, + array: true, + default: [], + null: false + end +end diff --git a/db/migrate/20230127121443_add_unique_project_download_limit_alertlist_to_namespace_settings.rb b/db/migrate/20230127121443_add_unique_project_download_limit_alertlist_to_namespace_settings.rb new file mode 100644 index 00000000000..4679d668843 --- /dev/null +++ b/db/migrate/20230127121443_add_unique_project_download_limit_alertlist_to_namespace_settings.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class AddUniqueProjectDownloadLimitAlertlistToNamespaceSettings < Gitlab::Database::Migration[2.1] + enable_lock_retries! + + def change + add_column :namespace_settings, :unique_project_download_limit_alertlist, + :integer, + array: true, + default: [], + null: false + end +end diff --git a/db/post_migrate/20230125093723_rebalance_partition_id_ci_pipeline.rb b/db/post_migrate/20230125093723_rebalance_partition_id_ci_pipeline.rb new file mode 100644 index 00000000000..aaea55ce331 --- /dev/null +++ b/db/post_migrate/20230125093723_rebalance_partition_id_ci_pipeline.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +class RebalancePartitionIdCiPipeline < Gitlab::Database::Migration[2.1] + MIGRATION = 'RebalancePartitionId' + DELAY_INTERVAL = 2.minutes + TABLE = :ci_pipelines + BATCH_SIZE = 2_000 + SUB_BATCH_SIZE = 200 + + restrict_gitlab_migration gitlab_schema: :gitlab_ci + + def up + return unless Gitlab.com? + + queue_batched_background_migration( + MIGRATION, + TABLE, + :id, + job_interval: DELAY_INTERVAL, + batch_size: BATCH_SIZE, + sub_batch_size: SUB_BATCH_SIZE + ) + end + + def down + return unless Gitlab.com? + + delete_batched_background_migration(MIGRATION, TABLE, :id, []) + end +end diff --git a/db/post_migrate/20230127131835_add_application_settings_git_users_alertlist_max_usernames_constraint.rb b/db/post_migrate/20230127131835_add_application_settings_git_users_alertlist_max_usernames_constraint.rb new file mode 100644 index 00000000000..77ef7e7eba5 --- /dev/null +++ b/db/post_migrate/20230127131835_add_application_settings_git_users_alertlist_max_usernames_constraint.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddApplicationSettingsGitUsersAlertlistMaxUsernamesConstraint < Gitlab::Database::Migration[2.1] + CONSTRAINT_NAME = 'app_settings_git_rate_limit_users_alertlist_max_usernames' + + disable_ddl_transaction! + + def up + add_check_constraint :application_settings, 'CARDINALITY(git_rate_limit_users_alertlist) <= 100', CONSTRAINT_NAME + end + + def down + remove_check_constraint :application_settings, CONSTRAINT_NAME + end +end diff --git a/db/post_migrate/20230127131915_add_namespace_settings_unique_project_download_limit_alertlist_size_constraint.rb b/db/post_migrate/20230127131915_add_namespace_settings_unique_project_download_limit_alertlist_size_constraint.rb new file mode 100644 index 00000000000..0777d31aa3b --- /dev/null +++ b/db/post_migrate/20230127131915_add_namespace_settings_unique_project_download_limit_alertlist_size_constraint.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class AddNamespaceSettingsUniqueProjectDownloadLimitAlertlistSizeConstraint < Gitlab::Database::Migration[2.1] + CONSTRAINT_NAME = 'namespace_settings_unique_project_download_limit_alertlist_size' + + disable_ddl_transaction! + + def up + add_check_constraint :namespace_settings, + 'CARDINALITY(unique_project_download_limit_alertlist) <= 100', + CONSTRAINT_NAME + end + + def down + remove_check_constraint :namespace_settings, CONSTRAINT_NAME + end +end diff --git a/db/schema_migrations/20230125093723 b/db/schema_migrations/20230125093723 new file mode 100644 index 00000000000..9c5782dcdac --- /dev/null +++ b/db/schema_migrations/20230125093723 @@ -0,0 +1 @@ +364f785b564d92d2956c5ffea71091561231888ffa6f4cd9125fc8ebf9150f77
\ No newline at end of file diff --git a/db/schema_migrations/20230127121107 b/db/schema_migrations/20230127121107 new file mode 100644 index 00000000000..3e3993908e0 --- /dev/null +++ b/db/schema_migrations/20230127121107 @@ -0,0 +1 @@ +a95107b71a3e9c6a07b2e50ad18c37b93d0ec3ebcda3cbb8075603f1fb91c555
\ No newline at end of file diff --git a/db/schema_migrations/20230127121443 b/db/schema_migrations/20230127121443 new file mode 100644 index 00000000000..b876d31ae78 --- /dev/null +++ b/db/schema_migrations/20230127121443 @@ -0,0 +1 @@ +08d2be57e3b7293bc6179e2265a7a627cb3b2327f6027039e9c3af9fa746425c
\ No newline at end of file diff --git a/db/schema_migrations/20230127131835 b/db/schema_migrations/20230127131835 new file mode 100644 index 00000000000..2b7f6d0e918 --- /dev/null +++ b/db/schema_migrations/20230127131835 @@ -0,0 +1 @@ +bf4c2b95c008f100045bad2b2c31ce03564f5b3299711ad7a423febd49117f52
\ No newline at end of file diff --git a/db/schema_migrations/20230127131915 b/db/schema_migrations/20230127131915 new file mode 100644 index 00000000000..0ba27861821 --- /dev/null +++ b/db/schema_migrations/20230127131915 @@ -0,0 +1 @@ +c5d7812734f7561736dafb427fe5276c248aad40a28304e6a785660bec2f54e2
\ No newline at end of file diff --git a/db/structure.sql b/db/structure.sql index 204b2d4f40a..4d5e58cd072 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -11639,10 +11639,12 @@ CREATE TABLE application_settings ( search_max_docs_denominator integer DEFAULT 5000000 NOT NULL, search_min_docs_before_rollover integer DEFAULT 100000 NOT NULL, deactivation_email_additional_text text, + git_rate_limit_users_alertlist integer[] DEFAULT '{}'::integer[] 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_container_registry_pre_import_tags_rate_positive CHECK ((container_registry_pre_import_tags_rate >= (0)::numeric)), 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_git_rate_limit_users_alertlist_max_usernames CHECK ((cardinality(git_rate_limit_users_alertlist) <= 100)), CONSTRAINT app_settings_git_rate_limit_users_allowlist_max_usernames CHECK ((cardinality(git_rate_limit_users_allowlist) <= 100)), CONSTRAINT app_settings_max_pages_custom_domains_per_project_check CHECK ((max_pages_custom_domains_per_project >= 0)), CONSTRAINT app_settings_max_terraform_state_size_bytes_check CHECK ((max_terraform_state_size_bytes >= 0)), @@ -18353,7 +18355,9 @@ CREATE TABLE namespace_settings ( default_compliance_framework_id bigint, runner_registration_enabled boolean DEFAULT true, allow_runner_registration_token boolean DEFAULT true NOT NULL, + unique_project_download_limit_alertlist integer[] DEFAULT '{}'::integer[] NOT NULL, CONSTRAINT check_0ba93c78c7 CHECK ((char_length(default_branch_name) <= 255)), + CONSTRAINT namespace_settings_unique_project_download_limit_alertlist_size CHECK ((cardinality(unique_project_download_limit_alertlist) <= 100)), CONSTRAINT namespace_settings_unique_project_download_limit_allowlist_size CHECK ((cardinality(unique_project_download_limit_allowlist) <= 100)) ); |