]> source.dussan.org Git - gitea.git/commitdiff
Improve DeleteByID (#26904)
authorLunny Xiao <xiaolunwen@gmail.com>
Tue, 5 Sep 2023 06:11:35 +0000 (14:11 +0800)
committerGitHub <noreply@github.com>
Tue, 5 Sep 2023 06:11:35 +0000 (08:11 +0200)
models/db/context.go

index 351aea8faf908eabb763da501ad9c66ca03bafbc..521857fae836174ac17ee486a554044e5515e1f4 100644 (file)
@@ -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