From 7cdf96d21a9d58920230fb96c9d0abc27888fee8 Mon Sep 17 00:00:00 2001 From: Ming Deng Date: Thu, 19 Aug 2021 21:49:37 +0800 Subject: [PATCH] Fix 4734: we don't need to reset the id to 0 --- orm/orm.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/orm/orm.go b/orm/orm.go index 0551b1cd..b43fae40 100644 --- a/orm/orm.go +++ b/orm/orm.go @@ -242,13 +242,7 @@ func (o *orm) Update(md interface{}, cols ...string) (int64, error) { func (o *orm) Delete(md interface{}, cols ...string) (int64, error) { mi, ind := o.getMiInd(md, true) num, err := o.alias.DbBaser.Delete(o.db, mi, ind, o.alias.TZ, cols) - if err != nil { - return num, err - } - if num > 0 { - o.setPk(mi, ind, 0) - } - return num, nil + return num, err } // create a models to models queryer