Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ Write the date in place of the "Unreleased" in the case a new version is release
from metadata responses when the request comes from a `python-tiled` client older than
v0.2.13, whose `Asset` dataclass has no `size` field and would otherwise crash
in `DataSource.from_json` with an unexpected keyword argument.
- Widen `assets.size` from `INTEGER` (int32) to `BIGINT` (int64) so the
server can register single files larger than ~2.1 GB without an
`int32 out of range` error from PostgreSQL. Includes an alembic
migration; SQLite is unaffected (its `INTEGER` affinity already stores
64-bit values).


## v0.2.13 (2026-07-08)
Expand Down
1 change: 1 addition & 0 deletions tiled/catalog/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

# This is list of all valid revisions (from current to oldest).
ALL_REVISIONS = [
"9bc9b57294b9",
"b93c79d197f4",
"e8956581ecd5",
"bf2fe0eb8ee8",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
"""Widen assets.size to BigInteger

Revision ID: 9bc9b57294b9
Revises: b93c79d197f4
Create Date: 2026-07-09 14:32:49.251181

"""

import sqlalchemy as sa
from alembic import op

# revision identifiers, used by Alembic.
revision = "9bc9b57294b9"
down_revision = "b93c79d197f4"
branch_labels = None
depends_on = None


def upgrade():
connection = op.get_bind()
if connection.engine.dialect.name == "postgresql":
op.alter_column(
"assets",
"size",
existing_type=sa.Integer(),
type_=sa.BigInteger(),
existing_nullable=True,
)
# SQLite: INTEGER affinity already stores 64-bit values, no schema change needed.


def downgrade():
connection = op.get_bind()
if connection.engine.dialect.name == "postgresql":
op.alter_column(
"assets",
"size",
existing_type=sa.BigInteger(),
type_=sa.Integer(),
existing_nullable=True,
)
3 changes: 2 additions & 1 deletion tiled/catalog/orm.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from sqlalchemy import (
JSON,
BigInteger,
Boolean,
Column,
DateTime,
Expand Down Expand Up @@ -534,7 +535,7 @@ class Asset(Timestamped, Base):
is_directory = Column(Boolean, nullable=False)
hash_type = Column(Unicode(63), nullable=True)
hash_content = Column(Unicode(1023), nullable=True)
size = Column(Integer, nullable=True)
size = Column(BigInteger, nullable=True)

# # many-to-many relationship to Asset, bypassing the `Association` class
data_sources: Mapped[List["DataSource"]] = relationship(
Expand Down
Loading