fix:修复因数据库缺少 working_hours 列导致 ROI 配置失败的问题。
- 手动执行 SQL:ALTER TABLE rois ADD COLUMN working_hours TEXT - 确保现有 SQLite 数据库(security_monitor.db)结构与模型定义一致 - 避免因字段缺失引发 API 或算法读取异常
This commit is contained in:
@@ -93,6 +93,7 @@ class ROI(Base):
|
||||
threshold_sec: Mapped[int] = mapped_column(Integer, default=300)
|
||||
confirm_sec: Mapped[int] = mapped_column(Integer, default=10)
|
||||
return_sec: Mapped[int] = mapped_column(Integer, default=30)
|
||||
working_hours: Mapped[Optional[str]] = mapped_column(Text, nullable=True)
|
||||
pending_sync: Mapped[bool] = mapped_column(Boolean, default=False)
|
||||
sync_version: Mapped[int] = mapped_column(Integer, default=0)
|
||||
created_at: Mapped[datetime] = mapped_column(DateTime, default=datetime.utcnow)
|
||||
|
||||
Reference in New Issue
Block a user