修正依赖问题
This commit is contained in:
6
vendor/gorm.io/gorm/schema/index.go
generated
vendored
6
vendor/gorm.io/gorm/schema/index.go
generated
vendored
@@ -13,8 +13,8 @@ type Index struct {
|
||||
Type string // btree, hash, gist, spgist, gin, and brin
|
||||
Where string
|
||||
Comment string
|
||||
Option string // WITH PARSER parser_name
|
||||
Fields []IndexOption
|
||||
Option string // WITH PARSER parser_name
|
||||
Fields []IndexOption // Note: IndexOption's Field maybe the same
|
||||
}
|
||||
|
||||
type IndexOption struct {
|
||||
@@ -67,7 +67,7 @@ func (schema *Schema) ParseIndexes() map[string]Index {
|
||||
}
|
||||
for _, index := range indexes {
|
||||
if index.Class == "UNIQUE" && len(index.Fields) == 1 {
|
||||
index.Fields[0].Field.Unique = true
|
||||
index.Fields[0].Field.UniqueIndex = index.Name
|
||||
}
|
||||
}
|
||||
return indexes
|
||||
|
||||
Reference in New Issue
Block a user