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

14 lines
326 B
Ruby

# frozen_string_literal: true
class FillGhostUserType < ActiveRecord::Migration[6.0]
DOWNTIME = false
def up
execute('UPDATE users SET user_type = 5 WHERE ghost IS TRUE AND user_type IS NULL')
end
def down
execute('UPDATE users SET user_type = NULL WHERE ghost IS TRUE AND user_type IS NOT NULL')
end
end