Files
NixReaperandClaude Sonnet 5 c20df1c503
CI / lint (push) Canceled after 0s
CI / typecheck (push) Canceled after 0s
CI / unit-tests (push) Canceled after 0s
CI / integration-tests (push) Canceled after 0s
CI / container-build (push) Canceled after 0s
CI / dependency-audit (push) Canceled after 0s
Initial Aurora Core 0.1 implementation
Production-grade media metadata backend per docs/aurora-core-spec.md:
Aurora-owned UUIDv7 identity system, normalized movie/TV/people/credits
schema, provider abstraction with a TMDb adapter, an idempotent async
ingestion pipeline (normalize -> match -> upsert -> provenance), a
Postgres FTS/trigram search layer, a stateless FastAPI v1 API with
Redis caching/rate-limiting, arq workers, dev/prod Docker Compose
topologies, unit + integration + load tests, CI, and architecture/
database/API/ERD documentation.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
2026-09-04 17:34:03 -05:00

33 lines
1.3 KiB
Python

"""People — first-class Aurora entities (section 6)."""
from __future__ import annotations
from datetime import date
from sqlalchemy import JSON, Date, Float, String, Text
from sqlalchemy.dialects.postgresql import JSONB
from sqlalchemy.orm import Mapped, mapped_column
from app.models.base import Base, TimestampMixin, UUIDPrimaryKeyMixin
JSONVariant = JSONB().with_variant(JSON(), "sqlite")
class Person(Base, UUIDPrimaryKeyMixin, TimestampMixin):
__tablename__ = "people"
name: Mapped[str] = mapped_column(String(300), nullable=False, index=True)
aliases: Mapped[list[str]] = mapped_column(JSONVariant, default=list)
biography: Mapped[str | None] = mapped_column(Text, nullable=True)
birthday: Mapped[date | None] = mapped_column(Date, nullable=True)
deathday: Mapped[date | None] = mapped_column(Date, nullable=True)
birthplace: Mapped[str | None] = mapped_column(String(300), nullable=True)
# Free-text, only populated when a source legitimately provides it —
# never inferred.
gender: Mapped[str | None] = mapped_column(String(30), nullable=True)
known_for_department: Mapped[str | None] = mapped_column(String(100), nullable=True)
popularity: Mapped[float | None] = mapped_column(Float, nullable=True)
__all__ = ["Person"]