go-admin-team / go-admin

基于Gin + Vue + Element UI & Arco Design & Ant Design 的前后端分离权限管理系统脚手架(包含了:多租户的支持,基础用户管理功能,jwt鉴权,代码生成器,RBAC资源控制,表单构建,定时任务等)3分钟构建自己的中后台项目;项目文档》:https://www.go-admin.pro V2 Demo: https://vue2.go-admin.dev V3 Demo: https://vue3.go-admin.dev Antd 订阅版:https://antd.go-admin.pro
https://www.go-admin.pro
MIT License
11.35k stars 2.36k forks source link

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

Open weishirongzhen opened 2 years ago

weishirongzhen commented 2 years ago

2022-04-29 16:59:01.614+0800 file:gorm@v1.21.11/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 commented 2 years ago

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

windmil commented 1 year ago

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,转为字符串就可以