1、定义字段类型 为 tinyint(1) 和 int(10) 2、执行迁移自动创建 bigint 类型的字段 go: 1.17.7 gorm: 1.23.2
which is important to help others understand your issue effectively and make sure the issue hasn't been fixed on latest master, checkouthttps://github.com/go-gorm/playgroundfor details. it will be closed in 30 days if no further activity occurs. if you are asking question, please use...
The fantastic ORM library for Golang, aims to be developer friendly - 表字段的数据类型定义错误,更新生成SQL不正确,gorm没有报告错误 · go-gorm/gorm@4a50b36
问题是 GORM 不确定新定义的类型的数据类型应该是什么,所以它试图弄清楚。相反,应该显式定义类型,在模型中使用标签或在新类型上实现 gorm 方法模型中的标记type MyModel struct { ... MyText MultiString `gorm:"type:text"`}这告诉 GORM 使用textDB 列类型的类型。使用此策略,...