alist-org / alist

🗂️A file list/WebDAV program that supports multiple storages, powered by Gin and Solidjs. / 一个支持多存储的文件列表/WebDAV程序,使用 Gin 和 Solidjs。
https://alist.nn.ci
GNU Affero General Public License v3.0
39.44k stars 5.12k forks source link

failed migrate database: insufficient arguments #6678

Open boomesy2023 opened 1 day ago

boomesy2023 commented 1 day ago

Please make sure of the following things

AList Version / AList 版本

v3.35.0

Driver used / 使用的存储驱动

本机存储

Describe the bug / 问题描述

数据库切换为PostgreSQL后,第一次启动时可以自动创建数据表以及初始数据,停止再次启动就会出现: github.com/alist-org/alist/v3/internal/db.Init() failed migrate database: insufficient arguments 错误。

Reproduction / 复现链接

拉取最新源码,编译运行

Config / 配置

"database": { "type": "postgres", "host": "127.0.0.1", "port": 5432, "user": "postgres", "password": "123456", "name": "sp_alist", "db_file": "", "tableprefix": "x", "ssl_mode": "disable", "dsn": "" } 其他无更改

Logs / 日志

No response

welcome[bot] commented 1 day ago

Thanks for opening your first issue here! Be sure to follow the issue template!

github-actions[bot] commented 1 day ago

See

  1. 54% #2846
  2. 52% #3746
boomesy2023 commented 1 day ago

查了 GORM 的issues,找到解决方案: https://github.com/go-gorm/gen/issues/1154。😓