Your Question

I defined a struct with autoUpdateTime field as here. It works when calling .Update() method. In my case, some complex json structure field would require .Exec(Raw SQL) to partial update, like JSON_SET, JSON_REMOVE. But this way, the autoUpdateTime field will not be updated.

The document you expected this should be explained

Expected answer

Is it possible to fix this problem? Like add a hook only to Exec() function? Thanks in advance!

Comment From: jinzhu

Maybe create a database on update constraint, not possible when executing raw SQL with GORM.