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