Skip to content

Commit

Permalink
Revert "fix: create index failed without err (#282)" (#284)
Browse files Browse the repository at this point in the history
This reverts commit f300cc4.
  • Loading branch information
jinzhu authored Sep 14, 2024
1 parent f300cc4 commit daf17c1
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions migrator.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,14 +146,7 @@ func (m Migrator) CreateIndex(value interface{}, name string) error {
createIndexSQL += " WHERE " + idx.Where
}

err := m.DB.Exec(createIndexSQL, values...).Error
if err != nil {
return err
}

if !m.HasIndex(value, name) {
return fmt.Errorf("failed to create index with name %v", name)
}
return m.DB.Exec(createIndexSQL, values...).Error
}
}

Expand Down

0 comments on commit daf17c1

Please sign in to comment.