How to define two Multiple-Column indexs with one same index?
Such as:
type Message struct {
Uid int64 `gorm:"index:idx_uid_time"`
Roomid int64 `gorm:"index:idx_roomid_time"`
Time int64 `gorm:"index:id_uid_time;index:idx_roomid_time"`
Data string
}
This don't work.
I read the source code. model_struct.go:parseTagSetting:547 use setting := map[string]string{}, this code setting[k] = strings.Join(v[1:], ":") ensure use only one index. So Time only use index:idx_roomid_time.
How can I do with that? Thanks.
gorm:"index:id_uid_time,idx_roomid_time"
Most helpful comment
gorm:"index:id_uid_time,idx_roomid_time"