Skip to content

Commit

Permalink
Revert "fix: create index failed without err (#285)" (#292)
Browse files Browse the repository at this point in the history
This reverts commit 0d37bf2.
  • Loading branch information
luantranminh authored Dec 2, 2024
1 parent 50307e2 commit 54c71e3
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions migrator.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,15 +150,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 nil
return m.DB.Exec(createIndexSQL, values...).Error
}
}

Expand Down

0 comments on commit 54c71e3

Please sign in to comment.