index: improve the comments for the test cases of composite id

This commit is contained in:
Chiung-Ming Huang 2022-04-24 19:10:53 +08:00
parent a0e23e45fa
commit b7fd54ddfb

View File

@ -20,15 +20,15 @@ type UserIndex struct {
MemberNumber string `gorm:"index:idx_id,priority:1"` MemberNumber string `gorm:"index:idx_id,priority:1"`
Name7 string `gorm:"index:type"` Name7 string `gorm:"index:type"`
// Composite Index: In the same level of struct. // Composite Index: Flattened structure.
Data0A string `gorm:"index:,composite:comp_id0"` Data0A string `gorm:"index:,composite:comp_id0"`
Data0B string `gorm:"index:,composite:comp_id0"` Data0B string `gorm:"index:,composite:comp_id0"`
// Composite Index: In the different levels of struct. // Composite Index: Nested structure.
Data1A string `gorm:"index:,composite:comp_id1"` Data1A string `gorm:"index:,composite:comp_id1"`
CompIdxLevel1C CompIdxLevel1C
// Composite Index: Unique and priority // Composite Index: Unique and priority.
Data2A string `gorm:"index:,unique,composite:comp_id2,priority:2"` Data2A string `gorm:"index:,unique,composite:comp_id2,priority:2"`
CompIdxLevel2C CompIdxLevel2C
} }