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

20230830084959_validate_push_rules_constraints.rb « migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 99b5d68064210355a0e248b30adf67e0db299df9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# frozen_string_literal: true

class ValidatePushRulesConstraints < Gitlab::Database::Migration[2.1]
  disable_ddl_transaction!

  REGEX_COLUMNS = %i[
    force_push_regex
    delete_branch_regex
    commit_message_regex
    commit_message_negative_regex
    author_email_regex
    file_name_regex
    branch_name_regex
  ].freeze

  def up
    REGEX_COLUMNS.each do |column_name|
      validate_check_constraint :push_rules, "#{column_name}_size_constraint"
    end
  end

  def down
    # No op
  end
end