` type AgentInfo struct {
Id int `gorm:"primary_key;AUTO_INCREMENT;column:id;type:int;" json:"id"`
AgentStatusTime Time `gorm:"column:agent_status_time;type:timestamp;default:CURRENT_TIMESTAMP;" json:"agentStatusTime"`
}
var a models.AgentInfo
err = db.Model(&models.AgentInfo{}).First(&a).Error ` 这个会在1.23.3版本中会报错,这个版本前的版本都不会报错。 报错位置为: schema/field.go 264行
Comment From: github-actions[bot]
The issue has been automatically marked as stale as it missing playground pull request link, which is important to help others understand your issue effectively and make sure the issue hasn't been fixed on latest master, checkout https://github.com/go-gorm/playground for details. it will be closed in 30 days if no further activity occurs. if you are asking question, please use the Question template, most likely your question already answered https://github.com/go-gorm/gorm/issues or described in the document https://gorm.io ✨ Search Before Asking ✨
Comment From: a631807682
https://github.com/go-gorm/gorm/issues/5176
Comment From: github-actions[bot]
The issue has been automatically marked as stale as it missing playground pull request link, which is important to help others understand your issue effectively and make sure the issue hasn't been fixed on latest master, checkout https://github.com/go-gorm/playground for details. it will be closed in 30 days if no further activity occurs. if you are asking question, please use the Question template, most likely your question already answered https://github.com/go-gorm/gorm/issues or described in the document https://gorm.io ✨ Search Before Asking ✨
Comment From: ajenpan
I got the same problem with gorm.io/gorm v1.23.3 gorm.io/driver/mysql v1.3.2
and it's right when I switch to gorm.io/gorm v1.23.2
and the model :
type Users struct {
UID int64 `gorm:"primaryKey;column:uid;type:bigint;not null" json:"-"`
Uname string `gorm:"unique;column:uname;type:varchar(64);not null" json:"uname"`
Passwd string `gorm:"column:passwd;type:varchar(64);not null;default:''" json:"passwd"`
Nickname string `gorm:"column:nickname;type:varchar(64);not null;default:''" json:"nickname"`
Roleid int `gorm:"column:roleid;type:int;not null;default:1" json:"roleid"`
Gender int8 `gorm:"column:gender;type:tinyint;not null;default:0" json:"gender"`
Avatar string `gorm:"column:avatar;type:varchar(1024);not null;default:''" json:"avatar"`
Phone string `gorm:"column:phone;type:varchar(32);not null;default:''" json:"phone"`
Email string `gorm:"column:email;type:varchar(64);not null;default:''" json:"email"`
Stat int8 `gorm:"column:stat;type:tinyint;not null;default:0" json:"stat"`
CreateAt time.Time `gorm:"column:create_at;type:datetime;not null;default:CURRENT_TIMESTAMP" json:"createAt"`
LastLoginAt time.Time `gorm:"column:last_login_at;type:datetime;not null;default:1000-01-01 00:00:00" json:"lastLoginAt"`
}
Comment From: github-actions[bot]
The issue has been automatically marked as stale as it missing playground pull request link, which is important to help others understand your issue effectively and make sure the issue hasn't been fixed on latest master, checkout https://github.com/go-gorm/playground for details. it will be closed in 30 days if no further activity occurs. if you are asking question, please use the Question template, most likely your question already answered https://github.com/go-gorm/gorm/issues or described in the document https://gorm.io ✨ Search Before Asking ✨
Comment From: jinzhu
Fixed in latest gorm release.