feat: P2V 파이프라인 연동 및 좋아요·댓글·공유 지원

- 무빙 포스터(p2v_video)·롱컷(p2v_playreel) 파이프라인과 워커, 갤러리·내 콘텐츠 노출
- 좋아요·댓글: comment/video_reaction에 p2v_playreel_id 추가, 종류별 CHECK 확장
- P2V 소프트 삭제(is_deleted), queued/running 삭제 차단
- 공개 상세·공유 OG 페이지 추가
- 삭제된 부모 댓글이 목록에서 사라지던 has_live_reply 서브쿼리 버그 수정
- 마이그레이션: migration_2026-10-15_p2v_reactions.sql
This commit is contained in:
skkim committed 2026-10-15 10:42:30 +09:00
1 parent bb1ea12958
commit b16d4a8f1b
126 files changed
+6921 -62

No files matched your search

+22 -5
View File
@@ -31,9 +31,11 @@ class Comment(Base):
작성자 닉네임은 카카오 로그인 정보를 작성 시점에 그대로 저장한 스냅샷이며,
프로필 이미지는 별도 컬럼 없이 응답 시 User 테이블을 조인해 최신값을 조회한다.
**ADO2 영상과 썰박스 콘텐츠를 모두 담는다.** 대상은 `video_id` 또는 `content_id`
중 **정확히 하나**만 채워지며, 이를 DB `CHECK` 로 강제한다. MySQL 은 하나의 FK 가
두 테이블을 조건부로 가리키게 할 수 없어 컬럼을 나눠 둔 것이다.
**ADO2 영상·썰박스·P2V(무빙 포스터·롱컷)를 모두 담는다.** 대상은 `video_id`,
`content_id`, `p2v_video_id`, `p2v_playreel_id` 중 **정확히 하나**만 채워지며, 이를
DB `CHECK` 로 강제한다. MySQL 은 하나의 FK 가 여러 테이블을 조건부로 가리키게 할 수
없어 컬럼을 나눠 둔 것이다. (DB 에는 옛 `p2v_poster_id` 도 남아 있어 CHECK 에 포함돼
있으나, 대응 테이블이 모델에 없어 여기서는 매핑하지 않는다.)
별도의 종류 컬럼은 두지 않는다 — 어느 FK 가 채워졌는지가 곧 종류이고,
컬럼을 하나 더 두면 둘이 어긋날 수 있다.
"""
@@ -41,11 +43,14 @@ class Comment(Base):
__tablename__ = "comment"
__table_args__ = (
CheckConstraint(
"(video_id IS NULL) <> (content_id IS NULL)",
"(video_id IS NOT NULL) + (content_id IS NOT NULL) "
"+ (p2v_video_id IS NOT NULL) + (p2v_playreel_id IS NOT NULL) = 1",
name="ck_comment_one_target",
),
Index("idx_comment_video_id", "video_id"),
Index("idx_comment_content_id", "content_id"),
Index("idx_comment_p2v_video_id", "p2v_video_id"),
Index("idx_comment_p2v_playreel_id", "p2v_playreel_id"),
Index("idx_comment_user_uuid", "user_uuid"),
Index("idx_comment_parent_id", "parent_id"),
Index("idx_comment_is_deleted", "is_deleted"),
@@ -59,7 +64,7 @@ class Comment(Base):
id: Mapped[int] = mapped_column(
Integer, primary_key=True, autoincrement=True, comment="고유 식별자"
)
# 대상은 아래 둘 중 **정확히 하나**만 채워진다 (ck_comment_one_target).
# 대상은 아래 넷 중 **정확히 하나**만 채워진다 (ck_comment_one_target).
video_id: Mapped[Optional[int]] = mapped_column(
Integer,
ForeignKey("video.id", ondelete="CASCADE"),
@@ -73,6 +78,18 @@ class Comment(Base):
nullable=True,
comment="썰박스 콘텐츠 id (ADO2 댓글이면 NULL)",
)
p2v_video_id: Mapped[Optional[int]] = mapped_column(
BigInteger,
ForeignKey("p2v_video.id", ondelete="CASCADE"),
nullable=True,
comment="무빙 포스터 id (다른 종류 댓글이면 NULL)",
)
p2v_playreel_id: Mapped[Optional[int]] = mapped_column(
BigInteger,
ForeignKey("p2v_playreel.id", ondelete="CASCADE"),
nullable=True,
comment="롱컷 id (다른 종류 댓글이면 NULL)",
)
user_uuid: Mapped[str] = mapped_column(
ForeignKey("user.user_uuid", ondelete="CASCADE"),
nullable=False,