add balance entity

This commit is contained in:
João Geonizeli
2021-08-11 09:28:42 -03:00
parent 2b9397b340
commit 38b60ca0fa
13 changed files with 184 additions and 14 deletions

View File

@@ -0,0 +1,13 @@
# frozen_string_literal: true
class CreateBalances < ActiveRecord::Migration[6.1]
def change
create_table(:balances) do |t|
t.references(:user, null: false, foreign_key: true)
t.references(:currency, null: false, foreign_key: true)
t.decimal(:amount, precision: 20, scale: 10, null: false, default: 0)
t.timestamps
end
end
end