mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2024-12-05 16:24:21 +01:00
19 lines
336 B
Ruby
19 lines
336 B
Ruby
|
class CreateWallets < ActiveRecord::Migration
|
||
|
def up
|
||
|
create_table :wallets do |t|
|
||
|
t.belongs_to :user, index: true, foreign_key: true
|
||
|
t.integer :amount, default: 0
|
||
|
|
||
|
t.timestamps null: false
|
||
|
end
|
||
|
|
||
|
User.all.each do |u|
|
||
|
Wallet.create(user: u)
|
||
|
end
|
||
|
end
|
||
|
|
||
|
def down
|
||
|
drop_table :wallets
|
||
|
end
|
||
|
end
|