Open weishirongzhen opened 2 years ago
pg数据库具体使用的话,可以加我wx,方便进一步了解您的这个问题,并处理。或者我们稍后尝试在测试库看能不能复现您的这个问题。
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,转为字符串就可以
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