01f5541e14
- Add 35 ForeignKey constraints across 15 tables (was zero) - ON DELETE CASCADE for parent-child relationships (project → children) - ON DELETE SET NULL for optional user references (created_by, assignee, etc.) - Add relationship() with back_populates and cascade on all models - Alter 11 columns from nullable=False to nullable=True for SET NULL - Add 2 missing indexes on FK columns (assets.uploaded_by_user_id, project_titles.created_by_user_id) - Update Pydantic response models to accept str | None for nullable fields - Add Alembic migration 010 with complete upgrade/downgrade Closes #17
24 lines
561 B
Python
24 lines
561 B
Python
from pydantic import BaseModel, Field
|
|
|
|
|
|
class CreateGenerationTaskRequest(BaseModel):
|
|
project_id: str = Field(..., min_length=1)
|
|
asset_library_id: str = Field(..., min_length=1)
|
|
strategy_id: str = ""
|
|
voice_library_id: str = ""
|
|
edit_plan_id: str = ""
|
|
created_by_user_id: str = ""
|
|
|
|
|
|
class GenerationTaskResponse(BaseModel):
|
|
id: str
|
|
project_id: str
|
|
asset_library_id: str
|
|
strategy_id: str
|
|
voice_library_id: str
|
|
edit_plan_id: str | None
|
|
status: str
|
|
progress: float
|
|
result_count: int
|
|
error_message: str
|