From b261f444783afbde5cbdbde775e46e11307f0178 Mon Sep 17 00:00:00 2001 From: Giteabot Date: Wed, 17 May 2023 14:35:20 -0400 Subject: [PATCH] Fix missed table name on iterate lfs meta objects (#24768) (#24774) Backport #24768 by @lunny Fix #24763 Co-authored-by: Lunny Xiao (cherry picked from commit 1bad05da3d5a35e20f5f36d41f9bfaa4617e550d) --- models/git/lfs.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/git/lfs.go b/models/git/lfs.go index 0ba8e919d0ecb..0f90b2920047b 100644 --- a/models/git/lfs.go +++ b/models/git/lfs.go @@ -390,7 +390,7 @@ func IterateLFSMetaObjectsForRepo(ctx context.Context, repoID int64, f func(cont for { beans := make([]*CountLFSMetaObject, 0, batchSize) - sess := engine.Select("`lfs_meta_object`.*, COUNT(`l1`.oid) AS `count`"). + sess := engine.Table("lfs_meta_object").Select("`lfs_meta_object`.*, COUNT(`l1`.oid) AS `count`"). Join("INNER", "`lfs_meta_object` AS l1", "`lfs_meta_object`.oid = `l1`.oid"). Where("`lfs_meta_object`.repository_id = ?", repoID) if !opts.OlderThan.IsZero() {