Add Currency entity to database

This commit is contained in:
qowevisa 2024-11-20 18:44:23 +02:00
parent cb60cb39d5
commit d41e6301e5
2 changed files with 15 additions and 0 deletions

14
db/currency.go Normal file
View File

@ -0,0 +1,14 @@
package db
import "gorm.io/gorm"
type Currency struct {
gorm.Model
Name string
ISOName string
Symbol string
}
func (c Currency) GetID() uint {
return c.ID
}

View File

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