Skip to content

Commit

Permalink
fix: foreignkey
Browse files Browse the repository at this point in the history
  • Loading branch information
zijiren233 committed Nov 15, 2024
1 parent d551ba4 commit 6fcad0b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion service/aiproxy/model/group.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ type Group struct {
CreatedAt time.Time `json:"created_at"`
AccessedAt time.Time `json:"accessed_at"`
ID string `gorm:"primaryKey" json:"id"`
Tokens []*Token `gorm:"foreignKey:GroupId;constraint:OnUpdate:CASCADE,OnDelete:CASCADE" json:"-"`
Tokens []*Token `gorm:"foreignKey:GroupID;constraint:OnUpdate:CASCADE,OnDelete:CASCADE" json:"-"`
Status int `gorm:"type:int;default:1;index" json:"status"`
UsedAmount float64 `gorm:"bigint;index" json:"used_amount"`
QPM int64 `gorm:"bigint" json:"qpm"`
Expand Down
2 changes: 1 addition & 1 deletion service/aiproxy/model/token.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ type Token struct {
CreatedAt time.Time `json:"created_at"`
ExpiredAt time.Time `json:"expired_at"`
AccessedAt time.Time `json:"accessed_at"`
Group *Group `gorm:"foreignKey:GroupId" json:"-"`
Group *Group `gorm:"foreignKey:GroupID" json:"-"`
Key string `gorm:"type:char(48);uniqueIndex" json:"key"`
Name EmptyNullString `gorm:"index;uniqueIndex:idx_group_name;not null" json:"name"`
GroupID string `gorm:"index;uniqueIndex:idx_group_name" json:"group"`
Expand Down

0 comments on commit 6fcad0b

Please sign in to comment.