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

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

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

  INDEX_NAME = 'unique_organizations_on_path'

  def up
    # text limit is added in 20230530112602_add_text_limit_on_organization_path
    add_column :organizations, :path, :text, null: false, default: '', if_not_exists: true # rubocop:disable Migration/AddLimitToTextColumns

    add_concurrent_index :organizations, :path, name: INDEX_NAME, unique: true
  end

  def down
    remove_column :organizations, :path, if_exists: true
  end
end