Skip to content

fix: widen file_size_bytes to BigInteger (int4 -> bigint)#99

Closed
ravirajsinh45 wants to merge 3 commits into
feature/instance-settings-storage-capfrom
fix/media-filesize-bigint
Closed

fix: widen file_size_bytes to BigInteger (int4 -> bigint)#99
ravirajsinh45 wants to merge 3 commits into
feature/instance-settings-storage-capfrom
fix/media-filesize-bigint

Conversation

@ravirajsinh45

Copy link
Copy Markdown
Contributor

Summary

MediaFile.file_size_bytes and CommentAttachment.file_size_bytes were INTEGER
(int4, ~2.1 GB ceiling) — so any file larger than ~2.1 GB could not be recorded at
all. This undermines #64 (per-file uploads are now nominally unlimited) and #98
(instance storage accounting sums these values). Widen both to BigInteger.

Stacked on #98 (feature/instance-settings-storage-cap) — this PR's diff is only
the column change, and its migration chains off #98's. Retarget to main once #98 merges.

Changes

  • MediaFile.file_size_bytes and CommentAttachment.file_size_bytesBigInteger.
  • Alembic migration 54b1ad156f8f (ALTER COLUMN … TYPE BIGINT), chained off dfcdaa30f89e.
  • Structural tests (apps/api/tests/test_filesize_bigint.py).

Testing

  • Full backend suite: 88 passed.
  • Migration applied to the dev DB; verified both columns are now BIGINT via the
    SQLAlchemy inspector (a wrong type would have shown here).

MediaFile.file_size_bytes and CommentAttachment.file_size_bytes were INTEGER
(int4, ~2.1GB ceiling), so files >2GB could not be recorded — undermining #64
(unlimited per-file uploads) and #98 (instance storage accounting). Migrate both
columns to BigInteger with an alembic migration. Structural tests added.
@ravirajsinh45 ravirajsinh45 force-pushed the feature/instance-settings-storage-cap branch from a4515fc to 44a1a45 Compare July 7, 2026 05:26
@ravirajsinh45 ravirajsinh45 force-pushed the fix/media-filesize-bigint branch from c90ba4c to 97e9a38 Compare July 7, 2026 05:26
@ravirajsinh45 ravirajsinh45 deleted the branch feature/instance-settings-storage-cap July 7, 2026 05:37
ravirajsinh45 added a commit that referenced this pull request Jul 7, 2026
@ravirajsinh45

Copy link
Copy Markdown
Contributor Author

Superseded by #104 — this PR was auto-closed when #98's base branch (feature/instance-settings-storage-cap) was deleted on merge. The branch was rebased onto main and reopened as #104 with the same change.

ravirajsinh45 added a commit that referenced this pull request Jul 7, 2026
* fix: widen file_size_bytes to BigInteger (int4 -> bigint)

MediaFile.file_size_bytes and CommentAttachment.file_size_bytes were INTEGER
(int4, ~2.1GB ceiling), so files >2GB could not be recorded — undermining #64
(unlimited per-file uploads) and #98 (instance storage accounting). Migrate both
columns to BigInteger with an alembic migration. Structural tests added.

* docs(changelog): add file_size_bytes bigint fix under [Unreleased] (#99)

* docs(migration): warn that int4->int8 widen locks media_files (ACCESS EXCLUSIVE) (review #99)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant