From 0b10df67cecd198559a38e42f3659f65aa759af2 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Tue, 5 Sep 2023 14:11:35 +0800 Subject: [PATCH] Improve DeleteByID (#26904) --- models/db/context.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/db/context.go b/models/db/context.go index 351aea8fa..521857fae 100644 --- a/models/db/context.go +++ b/models/db/context.go @@ -185,7 +185,7 @@ func DeleteByBean(ctx context.Context, bean any) (int64, error) { // DeleteByID deletes the given bean with the given ID func DeleteByID(ctx context.Context, id int64, bean any) (int64, error) { - return GetEngine(ctx).ID(id).NoAutoTime().Delete(bean) + return GetEngine(ctx).ID(id).NoAutoCondition().NoAutoTime().Delete(bean) } // FindIDs finds the IDs for the given table name satisfying the given condition