diff --git a/db/db.go b/db/db.go index 9662b70..1f1ef33 100644 --- a/db/db.go +++ b/db/db.go @@ -71,6 +71,7 @@ func Connect() *gorm.DB { gormDB.AutoMigrate(&Expense{}) gormDB.AutoMigrate(&Metric{}) gormDB.AutoMigrate(&Currency{}) + gormDB.AutoMigrate(&ExchangeRate{}) return newUDB } diff --git a/db/exchange_rate.go b/db/exchange_rate.go new file mode 100644 index 0000000..d3f4eb7 --- /dev/null +++ b/db/exchange_rate.go @@ -0,0 +1,14 @@ +package db + +import "gorm.io/gorm" + +type ExchangeRate struct { + gorm.Model + FromCurrID uint + FromCurr *Currency + From uint64 + ToCurrID uint + ToCurr *Currency + To uint64 + Rate uint64 +}