feat: Added personality_profile JSONB column to Creator model with migr…

- "backend/models.py"
- "backend/schemas.py"
- "backend/routers/creators.py"
- "alembic/versions/023_add_personality_profile.py"

GSD-Task: S06/T01
This commit is contained in:
jlightner 2026-04-04 08:24:44 +00:00
parent 7cc9497f3c
commit 442d0ca48b
4 changed files with 24 additions and 0 deletions

View file

@ -0,0 +1,21 @@
"""Add personality_profile JSONB column to creators.
Revision ID: 023_add_personality_profile
Revises: 022_add_creator_follows
"""
from alembic import op
revision = "023_add_personality_profile"
down_revision = "022_add_creator_follows"
branch_labels = None
depends_on = None
def upgrade() -> None:
op.execute("ALTER TABLE creators ADD COLUMN IF NOT EXISTS personality_profile JSONB")
def downgrade() -> None:
op.execute("ALTER TABLE creators DROP COLUMN IF EXISTS personality_profile")

View file

@ -130,6 +130,7 @@ class Creator(Base):
avatar_fetched_at: Mapped[datetime | None] = mapped_column(nullable=True) avatar_fetched_at: Mapped[datetime | None] = mapped_column(nullable=True)
bio: Mapped[str | None] = mapped_column(Text, nullable=True) bio: Mapped[str | None] = mapped_column(Text, nullable=True)
social_links: Mapped[dict | None] = mapped_column(JSONB, nullable=True) social_links: Mapped[dict | None] = mapped_column(JSONB, nullable=True)
personality_profile: Mapped[dict | None] = mapped_column(JSONB, nullable=True)
featured: Mapped[bool] = mapped_column(default=False, server_default="false") featured: Mapped[bool] = mapped_column(default=False, server_default="false")
view_count: Mapped[int] = mapped_column(Integer, default=0, server_default="0") view_count: Mapped[int] = mapped_column(Integer, default=0, server_default="0")
hidden: Mapped[bool] = mapped_column(default=False, server_default="false") hidden: Mapped[bool] = mapped_column(default=False, server_default="false")

View file

@ -186,6 +186,7 @@ async def get_creator(
**creator_data.model_dump(), **creator_data.model_dump(),
bio=creator.bio, bio=creator.bio,
social_links=creator.social_links, social_links=creator.social_links,
personality_profile=creator.personality_profile,
featured=creator.featured, featured=creator.featured,
video_count=video_count, video_count=video_count,
technique_count=len(techniques), technique_count=len(techniques),

View file

@ -63,6 +63,7 @@ class CreatorDetail(CreatorRead):
technique_count: int = 0 technique_count: int = 0
moment_count: int = 0 moment_count: int = 0
follower_count: int = 0 follower_count: int = 0
personality_profile: dict | None = None
techniques: list[CreatorTechniqueItem] = [] techniques: list[CreatorTechniqueItem] = []
genre_breakdown: dict[str, int] = {} genre_breakdown: dict[str, int] = {}