From f47376181317ccbf08dcdb28b0c0171dc5d61fda Mon Sep 17 00:00:00 2001 From: Aayush Acharya <33954116+aayushacharya@users.noreply.github.com> Date: Fri, 4 Aug 2023 08:20:59 +0545 Subject: [PATCH] fix: added `SkipHooks` in db `getInstance()` (#6484) --- gorm.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/gorm.go b/gorm.go index 9297850e5..203527af3 100644 --- a/gorm.go +++ b/gorm.go @@ -399,11 +399,12 @@ func (db *DB) getInstance() *DB { if db.clone == 1 { // clone with new statement tx.Statement = &Statement{ - DB: tx, - ConnPool: db.Statement.ConnPool, - Context: db.Statement.Context, - Clauses: map[string]clause.Clause{}, - Vars: make([]interface{}, 0, 8), + DB: tx, + ConnPool: db.Statement.ConnPool, + Context: db.Statement.Context, + Clauses: map[string]clause.Clause{}, + Vars: make([]interface{}, 0, 8), + SkipHooks: db.Statement.SkipHooks, } } else { // with clone statement