Add ExchangeRate entity to database

This commit is contained in:
qowevisa 2024-11-20 19:19:48 +02:00
parent 5f35b57eb4
commit f4cad689d8
2 changed files with 15 additions and 0 deletions

View File

@ -71,6 +71,7 @@ func Connect() *gorm.DB {
gormDB.AutoMigrate(&Expense{}) gormDB.AutoMigrate(&Expense{})
gormDB.AutoMigrate(&Metric{}) gormDB.AutoMigrate(&Metric{})
gormDB.AutoMigrate(&Currency{}) gormDB.AutoMigrate(&Currency{})
gormDB.AutoMigrate(&ExchangeRate{})
return newUDB return newUDB
} }

14
db/exchange_rate.go Normal file
View File

@ -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
}