""" 公告历史记录模型 """ from sqlalchemy import Column, Integer, String, DateTime, SmallInteger, Text from app.database import Base class AnnouncementHis(Base): """公告表历史记录""" __tablename__ = "announcements_his" his_id = Column(Integer, primary_key=True, autoincrement=True, comment="历史记录主键ID") id = Column(Integer, nullable=False, comment="原表主键ID") title = Column(String(200), nullable=False, comment="公告标题") content = Column(Text, nullable=False, comment="公告内容") priority = Column(SmallInteger, default=0, comment="优先级") is_active = Column(SmallInteger, default=1, comment="是否启用") publish_time = Column(DateTime, comment="发布时间") is_deleted = Column(SmallInteger, default=0, comment="是否删除:0-否,1-是") created_at = Column(DateTime, comment="创建时间") updated_at = Column(DateTime, comment="更新时间") his_created_at = Column(DateTime, comment="历史记录创建时间") his_operation = Column(String(10), nullable=False, comment="操作类型:INSERT/UPDATE/DELETE")