Fix 4734: do not reset id in Delete function

This commit is contained in:
Ming Deng
2021-08-19 21:34:00 +08:00
parent cf00f74882
commit d91a22c453
2 changed files with 2 additions and 7 deletions

View File

@@ -282,13 +282,7 @@ func (o *ormBase) Delete(md interface{}, cols ...string) (int64, error) {
func (o *ormBase) DeleteWithCtx(ctx context.Context, md interface{}, cols ...string) (int64, error) {
mi, ind := o.getMiInd(md, true)
num, err := o.alias.DbBaser.Delete(ctx, 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