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