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

数据库是pg, 执行 ./go-admin migrate 时报错 cannot convert 1599190683659 to Text #643

Open
weishirongzhen opened this issue Apr 29, 2022 · 2 comments
Labels

Comments

@weishirongzhen
Copy link

2022-04-29 16:59:01.614+0800 file:[email protected]/callbacks.go:133 level:trace /Users/wei/project/go_project/go-admin/cmd/migrate/migration/init.go:49 cannot convert 1599190683659 to Text [0.209ms] [rows:0] SELECT count(*) FROM "sys_migration" WHERE version = 1599190683659

@wenjianzhang
Copy link
Member

pg数据库具体使用的话,可以加我wx,方便进一步了解您的这个问题,并处理。或者我们稍后尝试在测试库看能不能复现您的这个问题。

@windmil
Copy link

windmil commented Jun 30, 2023

go-admin/cmd/migrate/migration/init.go 文件中
// err = e.db.Table("sys_migration").Where("version = ?", v).Count(&count).Error
修改为
err = e.db.Table("sys_migration").Where("version = ?", strconv.Itoa(v)).Count(&count).Error
version是字符串类型 v为int,转为字符串就可以

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants