这是您的操作方式:您需要使用gorm struct标记并指定索引是唯一的 type Something struct { gorm.Model First string `gorm:"index:idx_name,unique"` Second string ...
確定! 回上一頁