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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'db/migrate/20230530112122_add_path_to_organizations.rb')
-rw-r--r--db/migrate/20230530112122_add_path_to_organizations.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/db/migrate/20230530112122_add_path_to_organizations.rb b/db/migrate/20230530112122_add_path_to_organizations.rb
new file mode 100644
index 00000000000..fbd037f1251
--- /dev/null
+++ b/db/migrate/20230530112122_add_path_to_organizations.rb
@@ -0,0 +1,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