GORM Playground Link
https://github.com/go-gorm/playground/pull/1
Description
type CmeQuestion struct {
Id int gorm:"primary_key" json:"id"
QuestionTitle string json:"question_title"
AnalysisContent string json:"analysis_content"
Link string json:"link"
BindCount int json:"bind_count"
Deleted soft_delete.DeletedAt json:"deleted" gorm:"softDelete:flag"
Tag []CmeQuestionTag json:"tag" gorm:"many2many:question_tag;"
Selection []CmeQuestionSelection json:"selection" gorm:"foreignkey:CmeQuestionId"
CreateTime time.Time json:"create_time,omitempty" gorm:"autoCreateTime:true"
UpdateTime time.Time json:"update_time,omitempty" gorm:"autoUpdateTime:true"
DeleteTime gorm.DeletedAt json:"delete_time"
}
dao.Db.Session(&gorm.Session{FullSaveAssociations: true}).Updates(&dao.UpdateModel).Error
Comment From: zhuxianglong
有使用了官方文档的这种方法,也不对,不应该是删除他的中间关系表吗
Comment From: zhuxianglong
生成的sql竟然是操作user的这个表
Comment From: zhuxianglong
当前版本使用的是gorm.io/gorm v1.23.8
Comment From: zhuxianglong
@jinzhu 能看下这个问题吗?我发现这个确实是个bug
Comment From: zhuxianglong
中间表会不停的创建
Comment From: a631807682
If you think there is a bug, please create a PR to describe it in the playground. If you think this is an obvious bug, you should at least provide the simplest reproducible code snippet in your question. You just copied some code, even the model defined and updated are not the same. No one wants or has the energy to guess what's wrong with you.
Comment From: github-actions[bot]
This issue has been automatically marked as stale because it has been open 360 days with no activity. Remove stale label or comment or this will be closed in 180 days