Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
67eb7315
authored
Jul 20, 2025
by
CaIon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(topup): update TradeNo field to include varchar type and index for better database performance
parent
c634f950
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
model/topup.go
+3
-2
No files found.
model/topup.go
View file @
67eb7315
...
@@ -3,8 +3,9 @@ package model
...
@@ -3,8 +3,9 @@ package model
import
(
import
(
"errors"
"errors"
"fmt"
"fmt"
"gorm.io/gorm"
"one-api/common"
"one-api/common"
"gorm.io/gorm"
)
)
type
TopUp
struct
{
type
TopUp
struct
{
...
@@ -12,7 +13,7 @@ type TopUp struct {
...
@@ -12,7 +13,7 @@ type TopUp struct {
UserId
int
`json:"user_id" gorm:"index"`
UserId
int
`json:"user_id" gorm:"index"`
Amount
int64
`json:"amount"`
Amount
int64
`json:"amount"`
Money
float64
`json:"money"`
Money
float64
`json:"money"`
TradeNo
string
`json:"trade_no" gorm:"unique"`
TradeNo
string
`json:"trade_no" gorm:"unique
;type:varchar(255);index
"`
CreateTime
int64
`json:"create_time"`
CreateTime
int64
`json:"create_time"`
CompleteTime
int64
`json:"complete_time"`
CompleteTime
int64
`json:"complete_time"`
Status
string
`json:"status"`
Status
string
`json:"status"`
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment