You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
one-api-1 | [SYS] 2024/05/29 - 20:18:56 | One API v0.6.6-alpha.15 started
one-api-1 | [SYS] 2024/05/29 - 20:18:56 | using MySQL as database
one-api-1 | [SYS] 2024/05/29 - 20:18:56 | database migration started
one-api-1 |
one-api-1 | 2024/05/29 20:18:56 /build/model/main.go:117 Error 1406 (22001): Data too long for column 'models' at row 1
one-api-1 | [8.714ms] [rows:0] ALTER TABLE tokens MODIFY COLUMN models varchar(191) DEFAULT ''
one-api-1 | [FATAL] 2024/05/29 - 20:18:56 | [failed to initialize database: Error 1406 (22001): Data too long for column 'models' at row 1]
one-api-1 exited with code 0
one-api-1 | [SYS] 2024/05/29 - 20:18:56 | One API v0.6.6-alpha.15 started
one-api-1 | [SYS] 2024/05/29 - 20:18:56 | using MySQL as database
one-api-1 | [SYS] 2024/05/29 - 20:18:56 | database migration started
The text was updated successfully, but these errors were encountered:
例行检查
问题描述
先前使用docker部署的sqlite版本,积累了一定数据,想要将数据迁移到mysql下但是数据迁移成功后使用docker-compose启动连接mysql后会出现自动的alter字段的问题,sqlite下的token表的models字段text是合理的,但是启动的docker-compose连接mysql却要将其改为varchar(191),不太理解是什么原因
复现步骤
首先将sqlite的数据使用 sqlite3mysql -f one-api.db -d one_api -u xxx -p 迁移到mysql数据库,然后使用docker-compose启动oneapi并连接该数据库会出现异常无法启动,原因就是字段格式冲突
预期结果
token下的models实际上是text类型是合理的,如果限定为191后,有些token下支持特别多模型的情形应该就会有异常吧?
相关截图
one-api-1 | [SYS] 2024/05/29 - 20:18:56 | One API v0.6.6-alpha.15 started
one-api-1 | [SYS] 2024/05/29 - 20:18:56 | using MySQL as database
one-api-1 | [SYS] 2024/05/29 - 20:18:56 | database migration started
one-api-1 |
one-api-1 | 2024/05/29 20:18:56 /build/model/main.go:117 Error 1406 (22001): Data too long for column 'models' at row 1
one-api-1 | [8.714ms] [rows:0] ALTER TABLE
tokens
MODIFY COLUMNmodels
varchar(191) DEFAULT ''one-api-1 | [FATAL] 2024/05/29 - 20:18:56 | [failed to initialize database: Error 1406 (22001): Data too long for column 'models' at row 1]
one-api-1 exited with code 0
one-api-1 | [SYS] 2024/05/29 - 20:18:56 | One API v0.6.6-alpha.15 started
one-api-1 | [SYS] 2024/05/29 - 20:18:56 | using MySQL as database
one-api-1 | [SYS] 2024/05/29 - 20:18:56 | database migration started
The text was updated successfully, but these errors were encountered: