fix: widen file_size_bytes to BigInteger (int4 -> bigint)#99
Closed
ravirajsinh45 wants to merge 3 commits into
Closed
fix: widen file_size_bytes to BigInteger (int4 -> bigint)#99ravirajsinh45 wants to merge 3 commits into
ravirajsinh45 wants to merge 3 commits into
Conversation
ravirajsinh45
added a commit
that referenced
this pull request
Jul 6, 2026
ravirajsinh45
added a commit
that referenced
this pull request
Jul 7, 2026
ravirajsinh45
added a commit
that referenced
this pull request
Jul 7, 2026
… EXCLUSIVE) (review #99)
7a3dd00 to
c90ba4c
Compare
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.
… EXCLUSIVE) (review #99)
a4515fc to
44a1a45
Compare
c90ba4c to
97e9a38
Compare
ravirajsinh45
added a commit
that referenced
this pull request
Jul 7, 2026
ravirajsinh45
added a commit
that referenced
this pull request
Jul 7, 2026
… EXCLUSIVE) (review #99)
Contributor
Author
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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
MediaFile.file_size_bytesandCommentAttachment.file_size_byteswereINTEGER(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 onlythe column change, and its migration chains off #98's. Retarget to
mainonce #98 merges.Changes
MediaFile.file_size_bytesandCommentAttachment.file_size_bytes→BigInteger.54b1ad156f8f(ALTER COLUMN … TYPE BIGINT), chained offdfcdaa30f89e.apps/api/tests/test_filesize_bigint.py).Testing
BIGINTvia theSQLAlchemy inspector (a wrong type would have shown here).