From 4d0037a40c73ce799fdf2388e9b83a7e2474a02f Mon Sep 17 00:00:00 2001 From: CaIon Date: Sun, 20 Jul 2025 19:20:37 +0800 Subject: [PATCH] fix(topup): update TradeNo field to include varchar type and index for better database performance --- model/topup.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/model/topup.go b/model/topup.go index 39d96721..c34c0ce6 100644 --- a/model/topup.go +++ b/model/topup.go @@ -3,8 +3,9 @@ package model import ( "errors" "fmt" - "gorm.io/gorm" "one-api/common" + + "gorm.io/gorm" ) type TopUp struct { @@ -12,7 +13,7 @@ type TopUp struct { UserId int `json:"user_id" gorm:"index"` Amount int64 `json:"amount"` 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"` CompleteTime int64 `json:"complete_time"` Status string `json:"status"`