order by for delete not supported

This commit is contained in:
Gerhard Gruber 2021-11-23 14:44:27 +01:00
parent a06ca0d4d6
commit de609de5b3

View File

@ -447,7 +447,7 @@ func (s *DB) Create(value interface{}) *DB {
// Delete delete value match given conditions, if the value has primary key, then will including the primary key as condition // Delete delete value match given conditions, if the value has primary key, then will including the primary key as condition
func (s *DB) Delete(value interface{}, where ...interface{}) *DB { func (s *DB) Delete(value interface{}, where ...interface{}) *DB {
return s.NewScope(value).inlineCondition(where...).callCallbacks(s.parent.callbacks.deletes).db return s.Order(nil, true).NewScope(value).inlineCondition(where...).callCallbacks(s.parent.callbacks.deletes).db
} }
// Raw use raw sql as conditions, won't run it unless invoked by other methods // Raw use raw sql as conditions, won't run it unless invoked by other methods