From 0b27033fd079b0a4ba6c946b6e99d6ac061bfd00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20Sonck?= Date: Sat, 17 Aug 2024 13:39:33 +0200 Subject: [PATCH] fix(api): use bigint as size (#281) --- api/repo/file_repo.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/repo/file_repo.go b/api/repo/file_repo.go index 243717116..f11bda76e 100644 --- a/api/repo/file_repo.go +++ b/api/repo/file_repo.go @@ -511,7 +511,7 @@ func (repo *fileRepo) GetSize(id string) (int64, error) { Raw(`WITH RECURSIVE rec (id, parent_id) AS (SELECT f.id, f.parent_id FROM file f WHERE f.id = ? UNION SELECT f.id, f.parent_id FROM rec, file f WHERE f.parent_id = rec.id) - SELECT coalesce(sum((s.original->>'size')::int), 0) as result FROM snapshot s, rec + SELECT coalesce(sum((s.original->>'size')::bigint), 0) as result FROM snapshot s, rec LEFT JOIN snapshot_file map ON rec.id = map.file_id WHERE map.snapshot_id = s.id`, id). Scan(&res)