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

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

class IncreaseSizeOnInstanceLevelVariableValues < ActiveRecord::Migration[6.0]
  include Gitlab::Database::MigrationHelpers

  DOWNTIME = false

  disable_ddl_transaction!

  def up
    existing_constraint_name = text_limit_name(:ci_instance_variables, :encrypted_value)
    new_constraint_name = check_constraint_name(:ci_instance_variables, :encrypted_value, :char_length_updated)

    add_text_limit(:ci_instance_variables, :encrypted_value, 13_579, constraint_name: new_constraint_name)
    remove_check_constraint(:ci_instance_variables, existing_constraint_name)
  end

  def down
    # no-op
  end
end