From 066de35a77f6215296def7bea2665ed4e3bb0761 Mon Sep 17 00:00:00 2001 From: RedwindA Date: Fri, 27 Feb 2026 14:47:20 +0800 Subject: [PATCH] fix: change token model_limits column from varchar(1024) to text MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #3033 — users with many model limits hit PostgreSQL's varchar length constraint. The text type is supported across all three databases (SQLite, MySQL, PostgreSQL) with no length restriction. --- model/token.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/model/token.go b/model/token.go index 773b2d79..1c9ad3ed 100644 --- a/model/token.go +++ b/model/token.go @@ -23,7 +23,7 @@ type Token struct { RemainQuota int `json:"remain_quota" gorm:"default:0"` UnlimitedQuota bool `json:"unlimited_quota"` ModelLimitsEnabled bool `json:"model_limits_enabled"` - ModelLimits string `json:"model_limits" gorm:"type:varchar(1024);default:''"` + ModelLimits string `json:"model_limits" gorm:"type:text"` AllowIps *string `json:"allow_ips" gorm:"default:''"` UsedQuota int `json:"used_quota" gorm:"default:0"` // used quota Group string `json:"group" gorm:"default:''"`