diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-10-13 10:40:11 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-10-13 10:40:11 +0300 |
commit | f1ed8e540f1755b939a41700f34c136a2b530c19 (patch) | |
tree | e658c478c5fa442902df28eb438126e28fbe7246 | |
parent | 87cfefb548954a77e4e7946891096e7be38f7e88 (diff) |
Add latest changes from gitlab-org/gitlab@16-4-stable-ee
3 files changed, 10 insertions, 1 deletions
diff --git a/db/migrate/20230828153646_extend_push_rules_regex_limits.rb b/db/migrate/20230828153646_extend_push_rules_regex_limits.rb index ba5e8e54f9f..27b28adf08e 100644 --- a/db/migrate/20230828153646_extend_push_rules_regex_limits.rb +++ b/db/migrate/20230828153646_extend_push_rules_regex_limits.rb @@ -21,6 +21,8 @@ class ExtendPushRulesRegexLimits < Gitlab::Database::Migration[2.1] end LONG_REGEX_COLUMNS.each do |column_name| + next unless column_exists?(:push_rules, column_name) + add_check_constraint :push_rules, "char_length(#{column_name}) <= 2047", "#{column_name}_size_constraint", validate: false end @@ -32,6 +34,8 @@ class ExtendPushRulesRegexLimits < Gitlab::Database::Migration[2.1] end LONG_REGEX_COLUMNS.each do |column_name| + next unless column_exists?(:push_rules, column_name) + remove_check_constraint :push_rules, "#{column_name}_size_constraint" end end diff --git a/db/migrate/20230830084959_validate_push_rules_constraints.rb b/db/migrate/20230830084959_validate_push_rules_constraints.rb index 99b5d680642..ffd0d2605da 100644 --- a/db/migrate/20230830084959_validate_push_rules_constraints.rb +++ b/db/migrate/20230830084959_validate_push_rules_constraints.rb @@ -15,6 +15,8 @@ class ValidatePushRulesConstraints < Gitlab::Database::Migration[2.1] def up REGEX_COLUMNS.each do |column_name| + next unless column_exists?(:push_rules, column_name) + validate_check_constraint :push_rules, "#{column_name}_size_constraint" end end diff --git a/db/migrate/20230830085501_remove_push_rules_regex_limits.rb b/db/migrate/20230830085501_remove_push_rules_regex_limits.rb index 31d85e3ec11..c5bfb1ee080 100644 --- a/db/migrate/20230830085501_remove_push_rules_regex_limits.rb +++ b/db/migrate/20230830085501_remove_push_rules_regex_limits.rb @@ -5,10 +5,13 @@ class RemovePushRulesRegexLimits < Gitlab::Database::Migration[2.1] change_column :push_rules, :force_push_regex, :string, limit: nil change_column :push_rules, :delete_branch_regex, :string, limit: nil change_column :push_rules, :commit_message_regex, :string, limit: nil - change_column :push_rules, :commit_message_negative_regex, :string, limit: nil change_column :push_rules, :author_email_regex, :string, limit: nil change_column :push_rules, :file_name_regex, :string, limit: nil change_column :push_rules, :branch_name_regex, :string, limit: nil + + return unless column_exists?(:push_rules, :commit_message_negative_regex) + + change_column :push_rules, :commit_message_negative_regex, :string, limit: nil end def down |