如果使用uniqueIndex 创建了唯一索引,但是每次运行时会因为出现ALTER TABLE 语句,断点发现判断字段唯一性时仅仅读取了UNIQUE

Unique: utils.CheckTruth(tagSetting["UNIQUE"]),

未添加uniqueIndex 是有什么其他的考虑吗?望解答,谢谢!

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: li-jin-gou

@long980221 hello, uniqueIndex 可能是复合索引,所以不一定对,这个地方我研究一下怎么加

Comment From: long980221

@li-jin-gou 好的,谢谢

Comment From: a631807682

https://github.com/go-gorm/gorm/issues/6381#issuecomment-1929427042