mirror of https://github.com/go-gorm/gorm.git
Fix creation of composite unique indexes
This commit is contained in:
parent
a0848909c2
commit
87ff58b598
|
@ -570,7 +570,7 @@ func (scope *Scope) autoIndex() *Scope {
|
||||||
if name == "UNIQUE_INDEX" {
|
if name == "UNIQUE_INDEX" {
|
||||||
name = fmt.Sprintf("uix_%v_%v", scope.TableName(), field.DBName)
|
name = fmt.Sprintf("uix_%v_%v", scope.TableName(), field.DBName)
|
||||||
}
|
}
|
||||||
uniqueIndexes[name] = append(indexes[name], field.DBName)
|
uniqueIndexes[name] = append(uniqueIndexes[name], field.DBName)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue