diff --git a/main.go b/main.go index 97cff7db..8b43160f 100644 --- a/main.go +++ b/main.go @@ -281,7 +281,8 @@ func (s *DB) Last(out interface{}, where ...interface{}) *DB { // Find find records that match given conditions func (s *DB) Find(out interface{}, where ...interface{}) *DB { - return s.clone().NewScope(out).inlineCondition(where...).callCallbacks(s.parent.callbacks.queries).db + newScope := s.clone().NewScope(out) + return newScope.Set("gorm:order_by_primary_key", "ASC").inlineCondition(where...).callCallbacks(s.parent.callbacks.queries).db } // Scan scan value to a struct