Goon — self-hosted aggregator for adult-content scene metadata. Indexes scenes from TPDB, StashDB, and 30+ public adult tube sites. Cross-source deduplication via perceptual hash + Levenshtein distance. FastAPI backend + APScheduler worker + React Native (Expo) mobile client. FOSS, ad-free, donation-funded. See README for details.
48 lines
1.4 KiB
Python
48 lines
1.4 KiB
Python
"""favorite_studios — ulubione studia (single-user, in-app)
|
|
|
|
Revision ID: 0012_favorite_studios
|
|
Revises: 0011_origin_pornapp_to_tube
|
|
Create Date: 2026-05-08
|
|
|
|
Mirror `favorite_performers` ze studio_id zamiast performer_id. Single-user, więc
|
|
tabelka to po prostu zbiór studio_id które user oznaczył jako ulubione, plus
|
|
`last_seen_at` — mobile liczy ile nowych scen pojawiło się w danym studio od
|
|
ostatniego oglądania (badge w Favorites).
|
|
"""
|
|
from collections.abc import Sequence
|
|
|
|
import sqlalchemy as sa
|
|
from alembic import op
|
|
|
|
revision: str = "0012_favorite_studios"
|
|
down_revision: str | None = "0011_origin_pornapp_to_tube"
|
|
branch_labels: str | Sequence[str] | None = None
|
|
depends_on: str | Sequence[str] | None = None
|
|
|
|
|
|
def upgrade() -> None:
|
|
op.create_table(
|
|
"favorite_studios",
|
|
sa.Column(
|
|
"studio_id",
|
|
sa.dialects.postgresql.UUID(as_uuid=True),
|
|
sa.ForeignKey("studios.id", ondelete="CASCADE"),
|
|
primary_key=True,
|
|
),
|
|
sa.Column(
|
|
"created_at",
|
|
sa.DateTime(timezone=True),
|
|
server_default=sa.func.now(),
|
|
nullable=False,
|
|
),
|
|
sa.Column(
|
|
"last_seen_at",
|
|
sa.DateTime(timezone=True),
|
|
server_default=sa.func.now(),
|
|
nullable=False,
|
|
),
|
|
)
|
|
|
|
|
|
def downgrade() -> None:
|
|
op.drop_table("favorite_studios")
|