mirror of https://github.com/go-gorm/gorm.git
Test multiple index tags
This commit is contained in:
parent
d342f4122a
commit
65d6c19d73
|
@ -16,7 +16,7 @@ type UserIndex struct {
|
|||
Name5 int64 `gorm:"index:,class:FULLTEXT,comment:hello \\, world,where:age > 10"`
|
||||
Name6 int64 `gorm:"index:profile,comment:hello \\, world,where:age > 10"`
|
||||
Age int64 `gorm:"index:profile,expression:ABS(age)"`
|
||||
OID int64 `gorm:"index:idx_id"`
|
||||
OID int64 `gorm:"index:idx_id;index:idx_oid,unique"`
|
||||
MemberNumber string `gorm:"index:idx_id"`
|
||||
}
|
||||
|
||||
|
@ -70,6 +70,11 @@ func TestParseIndex(t *testing.T) {
|
|||
Name: "idx_id",
|
||||
Fields: []schema.IndexOption{{}, {}},
|
||||
},
|
||||
"idx_oid": {
|
||||
Name: "idx_oid",
|
||||
Class: "UNIQUE",
|
||||
Fields: []schema.IndexOption{{}},
|
||||
},
|
||||
}
|
||||
|
||||
indices := user.ParseIndexes()
|
||||
|
|
Loading…
Reference in New Issue