사용자의 uuid -> ksuid로 변경, 테이블 구조 변경

This commit is contained in:
Dohyun Lim committed 2026-01-28 14:05:15 +09:00
1 parent dc7351d0f9
commit aa8d9d7c14
13 files changed
+170 -75

No files matched your search

+9 -8
View File
@@ -1,7 +1,7 @@
from datetime import datetime
from typing import TYPE_CHECKING, Optional
from sqlalchemy import DateTime, ForeignKey, Integer, String, func
from sqlalchemy import DateTime, ForeignKey, Index, Integer, String, func
from sqlalchemy.orm import Mapped, mapped_column, relationship
from app.database.session import Base
@@ -24,7 +24,7 @@ class Video(Base):
project_id: 연결된 Project의 id (외래키)
lyric_id: 연결된 Lyric의 id (외래키)
song_id: 연결된 Song의 id (외래키)
task_id: 영상 생성 작업의 고유 식별자 (UUID 형식)
task_id: 영상 생성 작업의 고유 식별자 (KSUID 형식)
status: 처리 상태 (pending, processing, completed, failed 등)
result_movie_url: 생성된 영상 URL (S3, CDN 경로)
created_at: 생성 일시 (자동 설정)
@@ -37,6 +37,10 @@ class Video(Base):
__tablename__ = "video"
__table_args__ = (
Index("idx_video_task_id", "task_id"),
Index("idx_video_project_id", "project_id"),
Index("idx_video_lyric_id", "lyric_id"),
Index("idx_video_song_id", "song_id"),
{
"mysql_engine": "InnoDB",
"mysql_charset": "utf8mb4",
@@ -56,7 +60,6 @@ class Video(Base):
Integer,
ForeignKey("project.id", ondelete="CASCADE"),
nullable=False,
index=True,
comment="연결된 Project의 id",
)
@@ -64,7 +67,6 @@ class Video(Base):
Integer,
ForeignKey("lyric.id", ondelete="CASCADE"),
nullable=False,
index=True,
comment="연결된 Lyric의 id",
)
@@ -72,15 +74,14 @@ class Video(Base):
Integer,
ForeignKey("song.id", ondelete="CASCADE"),
nullable=False,
index=True,
comment="연결된 Song의 id",
)
task_id: Mapped[str] = mapped_column(
String(36),
String(27),
nullable=False,
index=True,
comment="영상 생성 작업 고유 식별자 (UUID)",
unique=True,
comment="영상 생성 작업 고유 식별자 (KSUID)",
)
creatomate_render_id: Mapped[Optional[str]] = mapped_column(