Skip to content

Commit 54c71e3

Browse files
authored
Revert "fix: create index failed without err (#285)" (#292)
This reverts commit 0d37bf2.
1 parent 50307e2 commit 54c71e3

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

migrator.go

+1-9
Original file line numberDiff line numberDiff line change
@@ -150,15 +150,7 @@ func (m Migrator) CreateIndex(value interface{}, name string) error {
150150
createIndexSQL += " WHERE " + idx.Where
151151
}
152152

153-
err := m.DB.Exec(createIndexSQL, values...).Error
154-
if err != nil {
155-
return err
156-
}
157-
158-
if !m.HasIndex(value, name) {
159-
return fmt.Errorf("failed to create index with name %v", name)
160-
}
161-
return nil
153+
return m.DB.Exec(createIndexSQL, values...).Error
162154
}
163155
}
164156

0 commit comments

Comments
 (0)