Add ExchangeRate entity to database
This commit is contained in:
parent
5f35b57eb4
commit
f4cad689d8
1
db/db.go
1
db/db.go
|
@ -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
14
db/exchange_rate.go
Normal 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
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user