Restructure backend and frontend modules; add story, library, and editor schema migrations. Support editable automatic production, manual confirmation modes, account and user lifecycle management, compact container scrolling, consistent forms, and per-task result previews. Update inference and TTS scheduling, deployment guidance, and regression coverage; remove obsolete standalone pages and temporary acceptance artifacts.
26 lines
503 B
Python
26 lines
503 B
Python
from datetime import datetime, timezone
|
|
|
|
import uuid
|
|
|
|
from sqlalchemy import DateTime
|
|
|
|
from sqlalchemy.orm import DeclarativeBase
|
|
|
|
from sqlalchemy.dialects.mysql import DATETIME
|
|
|
|
|
|
# MySQL 保留微秒,防止同秒创建的任务丢失 FIFO 顺序;不能退回普通 DATETIME。
|
|
Timestamp = DateTime().with_variant(DATETIME(fsp=6), "mysql")
|
|
|
|
|
|
def utcnow():
|
|
return datetime.now(timezone.utc).replace(tzinfo=None)
|
|
|
|
|
|
def new_id():
|
|
return uuid.uuid4().hex
|
|
|
|
|
|
class Base(DeclarativeBase):
|
|
pass
|