We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent eb02e3e commit fb83892Copy full SHA for fb83892
tests/hooks_test.go
@@ -274,7 +274,10 @@ func (s Product2) BeforeCreate(tx *gorm.DB) (err error) {
274
}
275
276
func (s *Product2) BeforeUpdate(tx *gorm.DB) (err error) {
277
- tx.Statement.Where("\"owner\" != ?", "admin")
+ // In Oracle DB, when owner is NULL, the condition "owner" != 'admin' will
278
+ // always returns false.
279
+ // Hence, we use NVL("owner", 'none') to substitute 'none' when owner is NULL.
280
+ tx.Statement.Where("NVL(\"owner\", 'none') != ?", "admin")
281
return
282
283
0 commit comments