사용자의 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 -7
View File
@@ -1,7 +1,7 @@
from datetime import datetime
from typing import TYPE_CHECKING, List, Optional
from sqlalchemy import DateTime, Float, ForeignKey, Integer, String, Text, func
from sqlalchemy import DateTime, Float, ForeignKey, Index, Integer, String, Text, func
from sqlalchemy.orm import Mapped, mapped_column, relationship
from app.database.session import Base
@@ -23,7 +23,7 @@ class Song(Base):
id: 고유 식별자 (자동 증가)
project_id: 연결된 Project의 id (외래키)
lyric_id: 연결된 Lyric의 id (외래키)
task_id: 노래 생성 작업의 고유 식별자 (UUID 형식)
task_id: 노래 생성 작업의 고유 식별자 (KSUID 형식)
suno_task_id: Suno API 작업 고유 식별자 (선택)
status: 처리 상태 (processing, uploading, completed, failed)
song_prompt: 노래 생성에 사용된 프롬프트
@@ -39,6 +39,9 @@ class Song(Base):
__tablename__ = "song"
__table_args__ = (
Index("idx_song_task_id", "task_id"),
Index("idx_song_project_id", "project_id"),
Index("idx_song_lyric_id", "lyric_id"),
{
"mysql_engine": "InnoDB",
"mysql_charset": "utf8mb4",
@@ -58,7 +61,6 @@ class Song(Base):
Integer,
ForeignKey("project.id", ondelete="CASCADE"),
nullable=False,
index=True,
comment="연결된 Project의 id",
)
@@ -66,14 +68,14 @@ class Song(Base):
Integer,
ForeignKey("lyric.id", ondelete="CASCADE"),
nullable=False,
index=True,
comment="연결된 Lyric의 id",
)
task_id: Mapped[str] = mapped_column(
String(36),
String(27),
nullable=False,
comment="노래 생성 작업 고유 식별자 (UUID)",
unique=True,
comment="노래 생성 작업 고유 식별자 (KSUID)",
)
suno_task_id: Mapped[Optional[str]] = mapped_column(
@@ -177,6 +179,7 @@ class SongTimestamp(Base):
__tablename__ = "song_timestamp"
__table_args__ = (
Index("idx_song_timestamp_suno_audio_id", "suno_audio_id"),
{
"mysql_engine": "InnoDB",
"mysql_charset": "utf8mb4",
@@ -195,7 +198,6 @@ class SongTimestamp(Base):
suno_audio_id: Mapped[str] = mapped_column(
String(64),
nullable=False,
index=True,
comment="가사의 원본 오디오 ID",
)