client_app_version.py 1.8 KB

12345678910111213141516171819202122232425262728293031
  1. """
  2. 客户端版本发布模型
  3. """
  4. from app.utils.timezone import beijing_now_naive
  5. from sqlalchemy import Column, Integer, String, Text, DateTime, Boolean
  6. from app.database import Base
  7. class ClientAppVersion(Base):
  8. """客户端版本发布表"""
  9. __tablename__ = "client_app_versions"
  10. id = Column(Integer, primary_key=True, autoincrement=True, comment="主键ID")
  11. platform = Column(String(20), nullable=False, default="windows", comment="平台: windows/macos/linux")
  12. channel = Column(String(20), nullable=False, default="stable", comment="发布通道: stable/beta")
  13. version = Column(String(50), nullable=False, comment="版本号,如 1.2.0")
  14. build_number = Column(Integer, nullable=True, comment="构建号")
  15. release_title = Column(String(120), nullable=True, comment="发布标题")
  16. release_notes_html = Column(Text, nullable=True, comment="富文本更新日志")
  17. download_url = Column(String(500), nullable=True, comment="下载地址")
  18. download_hash = Column(String(128), nullable=True, comment="下载包hash")
  19. is_force_update = Column(Boolean, default=False, comment="是否强制更新")
  20. min_supported_version = Column(String(50), nullable=True, comment="最低支持版本")
  21. status = Column(String(20), nullable=False, default="draft", comment="状态: draft/published/offline")
  22. published_at = Column(DateTime, nullable=True, comment="发布时间")
  23. created_by = Column(String(64), nullable=True, comment="创建人")
  24. updated_by = Column(String(64), nullable=True, comment="更新人")
  25. is_deleted = Column(Boolean, default=False, comment="是否删除: 0-否, 1-是")
  26. created_at = Column(DateTime, default=beijing_now_naive, comment="创建时间")
  27. updated_at = Column(DateTime, default=beijing_now_naive, onupdate=beijing_now_naive, comment="更新时间")