mirror of https://github.com/go-gorm/gorm.git
Fix AddUniqueIndex with soft delete
This commit is contained in:
parent
55a8e63aad
commit
8c099e0945
2
main.go
2
main.go
|
@ -547,7 +547,7 @@ func (s *DB) AddIndex(indexName string, columns ...string) *DB {
|
|||
|
||||
// AddUniqueIndex add unique index for columns with given name
|
||||
func (s *DB) AddUniqueIndex(indexName string, columns ...string) *DB {
|
||||
scope := s.clone().NewScope(s.Value)
|
||||
scope := s.clone().Unscoped().NewScope(s.Value)
|
||||
scope.addIndex(true, indexName, columns...)
|
||||
return scope.db
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue