debian-mirror-gitlab/db/migrate/20200311074438_migrate_bot_type_to_user_type.rb
2020-04-22 19:07:51 +05:30

14 lines
353 B
Ruby

# 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