GORM Playground Link
- https://github.com/go-gorm/playground/pull/695
- https://github.com/go-gorm/playground/pull/696
Description
A regression introduced in Gorm v1.25.6, specifically in commit https://github.com/go-gorm/gorm/commit/940358e0ddd1e6d5e893184943a4fa71a0c28521.
The behavior of the db.Not method when used with multiple Where conditions has changed unexpectedly. Prior to v1.25.6, the query db.Not(db.Where("a=1").Where("b=1")) would correctly translate to SQL as NOT (a=1 AND b=1). However, after the specified commit, the same query started translating to (NOT a=1 AND NOT b=1), which is a significant alteration in the logic.
I created PR (https://github.com/go-gorm/gorm/pull/6844) to address this issue.