Add CANT_FIND_CURRENCY error to db.go and fix problem when initCurrencies returned CANT_FIND_METRIC
This commit is contained in:
parent
282339e7af
commit
2566ec8eaa
3
db/db.go
3
db/db.go
|
@ -78,6 +78,7 @@ func Connect() *gorm.DB {
|
|||
|
||||
var (
|
||||
CANT_FIND_METRIC = errors.New("Can't find proper metrics in database")
|
||||
CANT_FIND_CURRENCY = errors.New("Can't find proper currencies in database")
|
||||
)
|
||||
|
||||
func checkSeededValues[T Identifiable](whatToCheck []*T, errorIfNotFound error, tx *gorm.DB) error {
|
||||
|
@ -127,7 +128,7 @@ func initCurrencies(tx *gorm.DB) error {
|
|||
{Name: "Kazakhstani Tenge", Symbol: "₸", ISOName: "KZT"},
|
||||
{Name: "Chinese Yuan", Symbol: "¥", ISOName: "CNY"},
|
||||
}
|
||||
return checkSeededValues(currsThatNeeded, CANT_FIND_METRIC, tx)
|
||||
return checkSeededValues(currsThatNeeded, CANT_FIND_CURRENCY, tx)
|
||||
}
|
||||
|
||||
func initStateOfDb(tx *gorm.DB) error {
|
||||
|
|
Loading…
Reference in New Issue
Block a user