I have following structure and would like to create unique index on (UserId and Contact). Is this possible in gorm?
type Contact struct {
gorm.Model
UserId uint `gorm:"index;not null"`
Contact string `gorm:"type:text;not null"`
}
I would like to create table something like
CREATE TABLE contact (...column definitions ...)
CONSTRAINT constraint1
UNIQUE (user_id, contact)