Problem with latest jinzhu/gorm library

I am working on a maintenance project in which old jinzu/gorm library is used but when i tried to use latest libray of jinzu/gorm from github (https://github.com/jinzhu/gorm). It is showing different behaviour. After debugging I found that in old gorm when we do - db.Where(“age = 20”).Find(&user)
It forms the below sql query-
SELECT * FROM users WHERE age = 20 AND (deleted_at IS NULL OR deleted_at <= 0001-01-02’);
but in latest gorm it forms below sql query:-
SELECT * FROM users WHERE deleted_at IS NULL AND age = 20 .

It causes different result set in project. I have used Unscoped() but I want to know other alternative for this to make it easier because I have to use Unscoped() at each query.

Please help me with this. Thanks in advance.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.