sandbox/home_app/db_investments.puml

39 lines
No EOL
800 B
Text

@startuml
!include db_styling.puml
package "Finances app" <<Frame>> {
entity "Deal" as deal_table {
PRIMARY_KEY(id) : INTEGER
--
FOREIGN_KEY(account_id) : INTEGER
FOREIGN_KEY(asset_id) : INTEGER
price : REAL
amount: INTEGER
commission : REAL
action : ENUM('buy', 'sell')
created_at : TIMESTAMP
description : TEXT
}
entity "Account" as account_table {
PRIMARY_KEY(id) : INTEGER
--
name : VARCHAR(10)
description : TEXT
is_active : BOOLEAN
}
entity "Asset" as asset_table {
PRIMARY_KEY(id) : INTEGER
---
name: VARCHAR(100)
ticker: VARCHAR(10)
}
}
deal_table ||--|| account_table
deal_table ||--|| asset_table
@enduml