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:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-18 12:09:31 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-18 12:09:31 +0300
commit6763d2787670bc03a36a8eb601703e88fc70dece (patch)
treeedc653ffd3052e3f9898c4fa8a07621d51574767 /db/migrate/20200311074438_migrate_bot_type_to_user_type.rb
parented9165c2abda1dca048a8d3cb8030d906c0bbb0c (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db/migrate/20200311074438_migrate_bot_type_to_user_type.rb')
-rw-r--r--db/migrate/20200311074438_migrate_bot_type_to_user_type.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/db/migrate/20200311074438_migrate_bot_type_to_user_type.rb b/db/migrate/20200311074438_migrate_bot_type_to_user_type.rb
new file mode 100644
index 00000000000..b13842794d3
--- /dev/null
+++ b/db/migrate/20200311074438_migrate_bot_type_to_user_type.rb
@@ -0,0 +1,13 @@
+# frozen_string_literal: true
+
+class MigrateBotTypeToUserType < ActiveRecord::Migration[6.0]
+ DOWNTIME = false
+
+ def up
+ execute('UPDATE users SET user_type = bot_type WHERE bot_type IS NOT NULL AND user_type IS NULL')
+ end
+
+ def down
+ execute('UPDATE users SET user_type = NULL WHERE bot_type IS NOT NULL AND bot_type = user_type')
+ end
+end