Commit cdf566e8 authored by John Mason's avatar John Mason Committed by Dylan Griffith

Change default search rate limits

Changelog: changed
parent 006df6a3
# frozen_string_literal: true
class ChangeSearchRateLimitDefaultValues < Gitlab::Database::Migration[1.0]
def change
change_column_default :application_settings, :search_rate_limit, from: 30, to: 300
change_column_default :application_settings, :search_rate_limit_unauthenticated, from: 10, to: 100
end
end
# frozen_string_literal: true
class ChangeSearchRateLimitValues < Gitlab::Database::Migration[1.0]
def up
# Change search_rate_limits to a more reasonable value
# as long as they are still using the default values.
#
# The reason why `search_rate_limit` could be either 30 or 60
# is because its value was ported over from the now deprecated
# `user_email_lookup_limit` which had a default value of 60.
execute("update application_settings set search_rate_limit=300 where search_rate_limit IN (30,60)")
execute("update application_settings set search_rate_limit_unauthenticated=100 where search_rate_limit_unauthenticated = 10")
end
def down
# noop. Because this migration is updating values, it is not reversible.
end
end
af69da66a3deb250494204fecf4bc91b4fd10f529ab766746ae98072f54bf245
\ No newline at end of file
465de916b1c951287a101da37156fb0f59a4bd1cb4ab7076dc48e07e326fa4e4
\ No newline at end of file
......@@ -11251,8 +11251,8 @@ CREATE TABLE application_settings (
users_get_by_id_limit integer DEFAULT 300 NOT NULL,
users_get_by_id_limit_allowlist text[] DEFAULT '{}'::text[] NOT NULL,
container_registry_expiration_policies_caching boolean DEFAULT true NOT NULL,
search_rate_limit integer DEFAULT 30 NOT NULL,
search_rate_limit_unauthenticated integer DEFAULT 10 NOT NULL,
search_rate_limit integer DEFAULT 300 NOT NULL,
search_rate_limit_unauthenticated integer DEFAULT 100 NOT NULL,
encrypted_database_grafana_api_key bytea,
encrypted_database_grafana_api_key_iv bytea,
database_grafana_api_url text,
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment