diff --git a/alembic/versions/023_add_personality_profile.py b/alembic/versions/023_add_personality_profile.py new file mode 100644 index 0000000..8189df1 --- /dev/null +++ b/alembic/versions/023_add_personality_profile.py @@ -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") diff --git a/backend/models.py b/backend/models.py index cd9a7f1..c070d25 100644 --- a/backend/models.py +++ b/backend/models.py @@ -130,6 +130,7 @@ class Creator(Base): avatar_fetched_at: Mapped[datetime | None] = mapped_column(nullable=True) bio: Mapped[str | None] = mapped_column(Text, 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") view_count: Mapped[int] = mapped_column(Integer, default=0, server_default="0") hidden: Mapped[bool] = mapped_column(default=False, server_default="false") diff --git a/backend/routers/creators.py b/backend/routers/creators.py index 2d2cd0a..c18b2cb 100644 --- a/backend/routers/creators.py +++ b/backend/routers/creators.py @@ -186,6 +186,7 @@ async def get_creator( **creator_data.model_dump(), bio=creator.bio, social_links=creator.social_links, + personality_profile=creator.personality_profile, featured=creator.featured, video_count=video_count, technique_count=len(techniques), diff --git a/backend/schemas.py b/backend/schemas.py index 5a7ad14..7c480e6 100644 --- a/backend/schemas.py +++ b/backend/schemas.py @@ -63,6 +63,7 @@ class CreatorDetail(CreatorRead): technique_count: int = 0 moment_count: int = 0 follower_count: int = 0 + personality_profile: dict | None = None techniques: list[CreatorTechniqueItem] = [] genre_breakdown: dict[str, int] = {}