Add Currency entity to database
This commit is contained in:
parent
cb60cb39d5
commit
d41e6301e5
14
db/currency.go
Normal file
14
db/currency.go
Normal 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
|
||||||
|
}
|
1
db/db.go
1
db/db.go
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user