gitlabhq/db/migrate/20130304104740_convert_blocked_to_state.rb
2013-03-05 14:29:44 +04:00

15 lines
336 B
Ruby

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
User.where(state: :blocked).update_all(blocked: :true)
end
end
end