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/20201127141433_add_other_role_to_user_details.rb')
-rw-r--r--db/migrate/20201127141433_add_other_role_to_user_details.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/db/migrate/20201127141433_add_other_role_to_user_details.rb b/db/migrate/20201127141433_add_other_role_to_user_details.rb
new file mode 100644
index 00000000000..586dbb033fd
--- /dev/null
+++ b/db/migrate/20201127141433_add_other_role_to_user_details.rb
@@ -0,0 +1,25 @@
+# frozen_string_literal: true
+
+class AddOtherRoleToUserDetails < ActiveRecord::Migration[6.0]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ disable_ddl_transaction!
+
+ def up
+ unless column_exists?(:user_details, :other_role)
+ with_lock_retries do
+ add_column :user_details, :other_role, :text
+ end
+ end
+
+ add_text_limit :user_details, :other_role, 100
+ end
+
+ def down
+ with_lock_retries do
+ remove_column :user_details, :other_role
+ end
+ end
+end