summaryrefslogtreecommitdiff
path: root/db/migrate/20220221102333_change_maintainer_note_limit_in_ci_runner.rb
blob: a3d71a060b86d4fb79e3626a3e5da671fa0ca985 (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
# frozen_string_literal: true

class ChangeMaintainerNoteLimitInCiRunner < Gitlab::Database::Migration[1.0]
  disable_ddl_transaction!

  def up
    add_text_limit(
      :ci_runners,
      :maintainer_note,
      1024,
      constraint_name: check_constraint_name(:ci_runners, :maintainer_note, 'max_length_1MB')
    )

    remove_text_limit(
      :ci_runners,
      :maintainer_note,
      constraint_name: check_constraint_name(:ci_runners, :maintainer_note, 'max_length')
    )
  end

  def down
    # no-op: Danger of failing if there are records with length(maintainer_note) > 255
  end
end