gitlab-org--gitlab-foss/db/migrate/20130304104740_convert_blocked_to_state.rb

16 lines
358 B
Ruby
Raw Normal View History

# rubocop:disable all
2013-03-04 09:51:00 -05:00
class ConvertBlockedToState < ActiveRecord::Migration
def up
User.transaction do
User.where(blocked: true).update_all(state: :blocked)
User.where(blocked: false).update_all(state: :active)
end
end
def down
User.transaction do
2013-03-05 05:29:44 -05:00
User.where(state: :blocked).update_all(blocked: :true)
2013-03-04 09:51:00 -05:00
end
end
end