Files
Scrobbler/src/scrobbler/migrations/versions/b3e8a5d1f720_user_avatar.py
T
mattandClaude Sonnet 5.5 c55a6596d0
CI / validate-monitoring (push) Successful in 8s
CI / lint (push) Successful in 16s
CI / federation-interop (push) Successful in 1m40s
CI / test (push) Successful in 4m48s
CI / images (push) Skipped
CI / assets (push) Skipped
CI / python-package (push) Skipped
CI / trigger-deploy (push) Skipped
CI / notify (push) Successful in 5s
Add uploaded profile images (SCR-1)
Users can upload, fetch and remove a profile image at /api/v1/me/avatar. The
bytes live in an avatars folder inside ART_STORAGE_DIR; the users row records the
source and content type. Adds metrics, AVATAR_UPLOAD_MAX_BYTES and the regenerated
OpenAPI document.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-13 11:39:43 +01:00

35 lines
830 B
Python

"""user avatar
Revision ID: b3e8a5d1f720
Revises: c7d2f08a19e4
Create Date: 2026-10-13 09:00:00.000000
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "b3e8a5d1f720"
down_revision = "c7d2f08a19e4"
branch_labels = None
depends_on = None
def upgrade():
op.add_column(
"users",
sa.Column("avatar_source", sa.String(length=16), server_default="none", nullable=False),
)
op.add_column("users", sa.Column("avatar_content_type", sa.String(length=32), nullable=True))
op.add_column(
"users", sa.Column("avatar_updated_at", sa.DateTime(timezone=True), nullable=True)
)
def downgrade():
op.drop_column("users", "avatar_updated_at")
op.drop_column("users", "avatar_content_type")
op.drop_column("users", "avatar_source")