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

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