Welcome to mirror list, hosted at ThFree Co, Russian Federation.

20210826171758_initialize_throttle_unauthenticated_api_columns.rb « post_migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 7615931464b03ab88d85dddda0fbd810d5a62002 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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