feat(files): store file sizes, add size range filter and sorting

Adds project_files.size (schema, idempotent migration, ensureFileSizesColumn), records multer size on both upload paths, backfills legacy rows from storage at startup and after restore (lib/file-sizes.js) with a lazy per-row update on read. GET /api/files and /api/files/detached accept min_size/max_size and a whitelisted sort (new/old/size_desc/size_asc); files page gets size and sort selects. size is carried through backup normalize/restore.
This commit is contained in:
dev
2026-10-23 10:25:16 +03:00
parent 621067a880
commit 7d610c549e
7 changed files with 101 additions and 16 deletions
+1
View File
@@ -348,6 +348,7 @@ function normalizeRestoreData(data) {
token: reqToken(x.token),
path: reqUploadPath(x.path, 255),
name: reqStr(x.name, 255),
size: optInt(x.size, 0, Number.MAX_SAFE_INTEGER),
detached_at: optTs(x.detached_at),
created_at: optTs(x.created_at),
}));