Skip to content

Stage 2 of bot_type column removal

Pavel Shutsin requested to merge 208897-remove-bot-type-column into master

What does this MR do?

It physically removes users.bot_type DB column as per columns removal guideline.

Should happen one release later than !26981 (merged)

Data migration and logic migration happened in !26981 (merged) Ignore column statement is already here: https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/models/user.rb#L65

Migration output

gitlab-rails git:(208897-remove-bot-type-column) ✗ be rake db:migrate
WARNING: This version of GitLab depends on gitlab-shell 12.2.0, but you're running Unknown. Please update gitlab-shell.
== 20200508091106 RemoveBotType: migrating ====================================
-- transaction_open?()
   -> 0.0000s
-- indexes(:users)
   -> 0.0305s
-- remove_index(:users, {:algorithm=>:concurrently, :name=>"index_users_on_bot_type"})
   -> 0.0035s
-- remove_column(:users, :bot_type)
   -> 0.0026s
== 20200508091106 RemoveBotType: migrated (0.0550s) ===========================

gitlab-rails git:(208897-remove-bot-type-column) ✗ be rake db:migrate:down VERSION=20200508091106
WARNING: This version of GitLab depends on gitlab-shell 12.2.0, but you're running Unknown. Please update gitlab-shell.
== 20200508091106 RemoveBotType: reverting ====================================
-- column_exists?(:users, :bot_type)
   -> 0.0034s
-- add_column(:users, :bot_type, :integer, {:limit=>2})
   -> 0.0007s
-- execute("UPDATE users set bot_type = user_type WHERE user_type IN(1,2,3,6)")
   -> 0.0119s
-- transaction_open?()
   -> 0.0000s
-- index_exists?(:users, :bot_type, {:algorithm=>:concurrently})
   -> 0.0101s
-- add_index(:users, :bot_type, {:algorithm=>:concurrently})
   -> 0.6527s
== 20200508091106 RemoveBotType: reverted (0.6832s) ===========================

Closes #208897 (closed)

Edited by Krasimir Angelov

Merge request reports