Fixed behaviour of "drop_unique_index"

This commit is contained in:
Dmitry Yu Okunev 2015-05-25 18:19:56 +03:00
parent 4019c14651
commit 4e4b2dfdd4

View File

@ -572,7 +572,7 @@ func (scope *Scope) autoIndex() *Scope {
indexes[name] = append(indexes[name], field.DBName)
}
if field.IgnoreUniqueIndex {
if !field.IgnoreUniqueIndex {
if name, ok := sqlSettings["UNIQUE_INDEX"]; ok {
if name == "UNIQUE_INDEX" {
name = fmt.Sprintf("uix_%v_%v", scope.TableName(), field.DBName)