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

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