Rename Account->Card in db package
This commit is contained in:
parent
cf09928a39
commit
aa69960519
|
@ -2,8 +2,8 @@ package db
|
||||||
|
|
||||||
import "gorm.io/gorm"
|
import "gorm.io/gorm"
|
||||||
|
|
||||||
// Account can be either card or wallet
|
// Card can be either card or wallet
|
||||||
type Account struct {
|
type Card struct {
|
||||||
gorm.Model
|
gorm.Model
|
||||||
Name string
|
Name string
|
||||||
Value uint64
|
Value uint64
|
2
db/db.go
2
db/db.go
|
@ -42,7 +42,7 @@ func Connect() *gorm.DB {
|
||||||
log.Panic(err)
|
log.Panic(err)
|
||||||
}
|
}
|
||||||
newUDB := gormDB
|
newUDB := gormDB
|
||||||
gormDB.AutoMigrate(&Account{})
|
gormDB.AutoMigrate(&Card{})
|
||||||
gormDB.AutoMigrate(&Category{})
|
gormDB.AutoMigrate(&Category{})
|
||||||
gormDB.AutoMigrate(&Item{})
|
gormDB.AutoMigrate(&Item{})
|
||||||
gormDB.AutoMigrate(&ItemPrice{})
|
gormDB.AutoMigrate(&ItemPrice{})
|
||||||
|
|
|
@ -8,8 +8,8 @@ import (
|
||||||
|
|
||||||
type Debt struct {
|
type Debt struct {
|
||||||
gorm.Model
|
gorm.Model
|
||||||
AccountID uint
|
CardID uint
|
||||||
Account *Account
|
Card *Card
|
||||||
Value uint64
|
Value uint64
|
||||||
IOwe bool
|
IOwe bool
|
||||||
Date time.Time
|
Date time.Time
|
||||||
|
|
|
@ -8,8 +8,8 @@ import (
|
||||||
|
|
||||||
type Income struct {
|
type Income struct {
|
||||||
gorm.Model
|
gorm.Model
|
||||||
AccountID uint
|
CardID uint
|
||||||
Account *Account
|
Card *Card
|
||||||
Value uint64
|
Value uint64
|
||||||
Date time.Time
|
Date time.Time
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,8 +9,8 @@ import (
|
||||||
// For grocery payment
|
// For grocery payment
|
||||||
type Payment struct {
|
type Payment struct {
|
||||||
gorm.Model
|
gorm.Model
|
||||||
AccountID uint
|
CardID uint
|
||||||
Account *Account
|
Card *Card
|
||||||
CategoryID uint
|
CategoryID uint
|
||||||
Category *Category
|
Category *Category
|
||||||
Name string
|
Name string
|
||||||
|
|
Loading…
Reference in New Issue
Block a user