internetee-registry/db/migrate/20150410124724_create_accounts.rb
2015-04-14 13:55:32 +03:00

15 lines
325 B
Ruby

class CreateAccounts < ActiveRecord::Migration
def change
create_table :accounts do |t|
t.integer :registrar_id
t.string :account_type
t.decimal :balance
t.timestamps
end
Registrar.all.each do |x|
Account.create(registrar_id: x.id, account_type: Account::CASH)
end
end
end