diff options
Diffstat (limited to 'db/post_migrate/20210826171758_initialize_throttle_unauthenticated_api_columns.rb')
-rw-r--r-- | db/post_migrate/20210826171758_initialize_throttle_unauthenticated_api_columns.rb | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/db/post_migrate/20210826171758_initialize_throttle_unauthenticated_api_columns.rb b/db/post_migrate/20210826171758_initialize_throttle_unauthenticated_api_columns.rb new file mode 100644 index 00000000000..7615931464b --- /dev/null +++ b/db/post_migrate/20210826171758_initialize_throttle_unauthenticated_api_columns.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +# Initialize the new `throttle_unauthenticated_api_*` columns with the current values +# from the `throttle_unauthenticated_*` columns, which will now only apply to web requests. +# +# The columns for the unauthenticated web rate limit will be renamed later +# in https://gitlab.com/gitlab-org/gitlab/-/issues/340031. +class InitializeThrottleUnauthenticatedApiColumns < ActiveRecord::Migration[6.1] + class ApplicationSetting < ActiveRecord::Base + self.table_name = :application_settings + end + + def up + ApplicationSetting.update_all(%q{ + throttle_unauthenticated_api_enabled = throttle_unauthenticated_enabled, + throttle_unauthenticated_api_requests_per_period = throttle_unauthenticated_requests_per_period, + throttle_unauthenticated_api_period_in_seconds = throttle_unauthenticated_period_in_seconds + }) + end + + def down + end +end |