Files
xiaoxia-saas/apps/api/app/schemas/generation_task.py
T
API文档维护Agent 01f5541e14
Tests / test (pull_request) Failing after 0s
Tests / lint (pull_request) Failing after 0s
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Has been cancelled
CI/CD Pipeline / Frontend Lint (pull_request) Has been cancelled
fix: add foreign key constraints to all ORM models
- 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
2026-06-28 08:45:44 +08:00

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