Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions internal/entity/invest_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ import (
)

type InvestAccount struct {
ID uint `gorm:"primarykey" json:"id"`
IP string `gorm:"type:varchar(16);unique" json:"ip"`
CreatedAt time.Time ` json:"created_at"`
UpdatedAt time.Time ` json:"updated_at"`
DeletedAt gorm.DeletedAt `gorm:"index" json:"deleted_at"`
Code string `gorm:"type:varchar(64);index" json:"code"`
InvestCode InvestCode `gorm:"foreignKey:Code;references:Code" json:"-"`
ID uint `gorm:"primarykey" json:"id"`
IP string `gorm:"type:varchar(16);unique" json:"ip"`
CreatedAt time.Time ` json:"created_at"`
UpdatedAt time.Time ` json:"updated_at"`
DeletedAt gorm.DeletedAt `gorm:"index" json:"deleted_at"`
Code string `gorm:"type:varchar(64);index" json:"code"`
// InvestCode InvestCode `gorm:"foreignKey:Code;references:Code" json:"-"`
}

// TableName returns the entity table name.
Expand Down
6 changes: 3 additions & 3 deletions internal/entity/invest_code.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
)

type InvestCode struct {
Code string `gorm:"primarykey" json:"code"`
SocialNetwork string `gorm:"type:varchar(64)" json:"social_network"`
InvestAccounts []InvestAccount `gorm:"foreignKey:Code;references:Code"`
Code string `gorm:"primarykey" json:"code"`
SocialNetwork string `gorm:"type:varchar(64)" json:"social_network"`
// InvestAccounts []InvestAccount `gorm:"foreignKey:Code;references:Code"`
}

// TableName returns the entity table name.
Expand Down