Class: ShopUserUpdatesMigration

Inherits:
Migration
  • Object
show all
Defined in:
lib/migrations/02_shop_user_updates.rb

Class Method Summary collapse

Class Method Details

.down(site) ⇒ Object



8
9
10
11
12
# File 'lib/migrations/02_shop_user_updates.rb', line 8

def self.down(site)
  site.users.modify do
    remove_field :balance
  end
end

.up(site) ⇒ Object



2
3
4
5
6
# File 'lib/migrations/02_shop_user_updates.rb', line 2

def self.up(site)
  site.users.modify do
    add_field :balance, :decimal, validations: {required: {}}, default: '0.0'
  end
end