refactor(core,ai): 调整模块导入路径并移除废弃文件 - 修复 scheduler.py 中的导入路径错误,将 reports.service 改为 reports.services - 移除废弃的 app/core/background/task_queue.py 文件 - 移除废弃的 app/modules/ai_agent/adapters.py 文件 - 修复 ai_memory/service.py 中的导入路径错误,将 events.service 改为 events.services ```
29 lines
1.3 KiB
Python
29 lines
1.3 KiB
Python
from datetime import datetime
|
|
|
|
from sqlalchemy import DateTime, Integer, String, Text
|
|
from sqlalchemy.orm import Mapped, mapped_column
|
|
|
|
from app.core.database import Base
|
|
from app.core.utils.time import utc_now
|
|
from app.modules.business.constants import (
|
|
StatusValue,
|
|
)
|
|
from app.modules.business.models.common import TimestampMixin
|
|
|
|
|
|
class LegacySyncRun(Base, TimestampMixin):
|
|
__tablename__ = "legacy_sync_runs"
|
|
|
|
id: Mapped[int] = mapped_column(Integer, primary_key=True, autoincrement=True)
|
|
code: Mapped[str] = mapped_column(String(64), unique=True, index=True)
|
|
domain: Mapped[str] = mapped_column(String(128), index=True)
|
|
source_table: Mapped[str | None] = mapped_column(String(128), nullable=True, index=True)
|
|
status: Mapped[str] = mapped_column(String(32), default=StatusValue.RUNNING, index=True)
|
|
started_at: Mapped[datetime] = mapped_column(DateTime, default=utc_now, index=True)
|
|
finished_at: Mapped[datetime | None] = mapped_column(DateTime, nullable=True)
|
|
created_count: Mapped[int] = mapped_column(Integer, default=0)
|
|
updated_count: Mapped[int] = mapped_column(Integer, default=0)
|
|
skipped_count: Mapped[int] = mapped_column(Integer, default=0)
|
|
error_message: Mapped[str | None] = mapped_column(Text, nullable=True)
|
|
note: Mapped[str | None] = mapped_column(Text, nullable=True)
|