Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: modify the type of token models to be text #1761

Merged
merged 2 commits into from
Sep 22, 2024

Conversation

xuruidong
Copy link
Contributor

close #issue_number

If MySQL is used as the database, the default data type for "token models" is "varchar(191)". When we create a token object with many models, the model data string will be truncated in the database.

在使用 MySQL 作为数据库时, tokens 表中的 models 字段的类型是 varchar, 当创建 token 时配置的模型数量过多时,会导致数据不能完全保存。

有另外一个有点关系的 issue: #1483

我已确认该 PR 已自测通过,相关截图如下:
(此处放上测试通过的截图,如果不涉及前端改动或从 UI 上无法看出,请放终端启动成功的截图)
image
image

Copy link

codecov bot commented Sep 22, 2024

Codecov Report

Attention: Patch coverage is 0% with 14 lines in your changes missing coverage. Please review.

Project coverage is 1.27%. Comparing base (f977469) to head (d7c617e).
Report is 14 commits behind head on main.

Files with missing lines Patch % Lines
model/token.go 0.00% 14 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##            main   #1761      +/-   ##
========================================
- Coverage   1.30%   1.27%   -0.03%     
========================================
  Files        144     145       +1     
  Lines      10153   10377     +224     
========================================
  Hits         132     132              
- Misses     10007   10231     +224     
  Partials      14      14              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@songquanpeng songquanpeng merged commit 29389ed into songquanpeng:main Sep 22, 2024
2 checks passed
@songquanpeng
Copy link
Owner

Thx~

@xuruidong xuruidong deleted the patch-1 branch September 23, 2024 02:05
mxdlzg pushed a commit to mxdlzg/one-api that referenced this pull request Oct 15, 2024
* fix: modify the type of token models to be text

* chore: update receiver name

---------

Co-authored-by: JustSong <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants