summaryrefslogtreecommitdiff
path: root/db/post_migrate/20221121155850_change_vulnerabilities_state_transitions_comment_limit.rb
blob: b75216ee413df036f594f2f3fcf959940bf9f0d7 (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

class ChangeVulnerabilitiesStateTransitionsCommentLimit < Gitlab::Database::Migration[2.0]
  disable_ddl_transaction!

  def up
    add_text_limit(
      :vulnerability_state_transitions,
      :comment,
      50_000,
      constraint_name: check_constraint_name(:vulnerability_state_transitions, :comment, 'max_length_50000')
    )
    remove_text_limit(
      :vulnerability_state_transitions,
      :comment,
      constraint_name: 'check_fca4a7ca39'
    )
  end

  def down
    # no-op: this can fail if records with length > 255 (previous limit) show up
  end
end