diff --git a/db/currency.go b/db/currency.go new file mode 100644 index 0000000..cdd3358 --- /dev/null +++ b/db/currency.go @@ -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 +} diff --git a/db/db.go b/db/db.go index 2e116e9..376fe61 100644 --- a/db/db.go +++ b/db/db.go @@ -70,6 +70,7 @@ func Connect() *gorm.DB { gormDB.AutoMigrate(&Session{}) gormDB.AutoMigrate(&Expense{}) gormDB.AutoMigrate(&Metric{}) + gormDB.AutoMigrate(&Currency{}) return newUDB }