mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-06-01 13:27:54 +08:00
### What problem does this PR solve? Fixes #6034 Changes the `size` field in both `Document` and `File` models from `IntegerField` (32-bit, max ~2GB) to `BigIntegerField` (64-bit, max ~9.2EB), and adds corresponding database migrations. ## Problem When uploading a file larger than 2GB, the `size` value overflows a 32-bit signed integer (max 2,147,483,647). This causes: - The stored `size` wraps around to an incorrect value (e.g., a 3GB file shows as 2,097,152 KB in File Management). - Subsequent file operations (e.g., download) fail because the corrupted size leads to invalid storage lookups. ## Changes - `Document.size`: `IntegerField` → `BigIntegerField` - `File.size`: `IntegerField` → `BigIntegerField` - Added `alter_db_column_type` migrations in `migrate_db()` for both `document.size` and `file.size` columns to ensure existing deployments are upgraded automatically. ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) Signed-off-by: noob <yixiao121314@outlook.com>