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

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

class AddNameAndDescriptionToMemberRoles < Gitlab::Database::Migration[2.1]
  disable_ddl_transaction!

  def up
    with_lock_retries do
      add_column :member_roles, :name, :text, null: false, default: 'Custom', if_not_exists: true
      add_column :member_roles, :description, :text, if_not_exists: true
    end

    add_text_limit :member_roles, :name, 255
    add_text_limit :member_roles, :description, 255
  end

  def down
    with_lock_retries do
      remove_column :member_roles, :name, :text, if_exists: true
      remove_column :member_roles, :description, :text, if_exists: true
    end
  end
end