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

20210216193620_add_description_to_cluster_token.rb « migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 67f7c6bd522044c4e50ec9b23a49516af2701c33 (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 AddDescriptionToClusterToken < ActiveRecord::Migration[6.0]
  include Gitlab::Database::MigrationHelpers

  DOWNTIME = false

  disable_ddl_transaction!

  def up
    unless column_exists?(:cluster_agent_tokens, :description)
      add_column :cluster_agent_tokens, :description, :text
    end

    add_text_limit :cluster_agent_tokens, :description, 1024
  end

  def down
    remove_column :cluster_agent_tokens, :description
  end
end