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
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]>
43 lines
1.2 KiB
Python
43 lines
1.2 KiB
Python
"""Keywords/tags and their movie/series associations."""
|
|
|
|
from __future__ import annotations
|
|
|
|
import uuid
|
|
|
|
from sqlalchemy import ForeignKey, String
|
|
from sqlalchemy.orm import Mapped, mapped_column
|
|
|
|
from app.models.base import Base, UUIDPrimaryKeyMixin
|
|
|
|
|
|
class Keyword(Base, UUIDPrimaryKeyMixin):
|
|
__tablename__ = "keywords"
|
|
|
|
name: Mapped[str] = mapped_column(String(150), unique=True, nullable=False)
|
|
slug: Mapped[str] = mapped_column(String(150), unique=True, nullable=False)
|
|
|
|
|
|
class MovieKeyword(Base):
|
|
__tablename__ = "movie_keywords"
|
|
|
|
movie_id: Mapped[uuid.UUID] = mapped_column(
|
|
ForeignKey("movies.id", ondelete="CASCADE"), primary_key=True
|
|
)
|
|
keyword_id: Mapped[uuid.UUID] = mapped_column(
|
|
ForeignKey("keywords.id", ondelete="CASCADE"), primary_key=True
|
|
)
|
|
|
|
|
|
class SeriesKeyword(Base):
|
|
__tablename__ = "series_keywords"
|
|
|
|
series_id: Mapped[uuid.UUID] = mapped_column(
|
|
ForeignKey("series.id", ondelete="CASCADE"), primary_key=True
|
|
)
|
|
keyword_id: Mapped[uuid.UUID] = mapped_column(
|
|
ForeignKey("keywords.id", ondelete="CASCADE"), primary_key=True
|
|
)
|
|
|
|
|
|
__all__ = ["Keyword", "MovieKeyword", "SeriesKeyword"]
|