""" 操作日志历史记录模型 """ from sqlalchemy import Column, BigInteger, Integer, String, DateTime, Text, SmallInteger from app.database import Base class OperationLogHis(Base): """操作日志表历史记录""" __tablename__ = "operation_logs_his" his_id = Column(Integer, primary_key=True, autoincrement=True, comment="历史记录主键ID") id = Column(BigInteger, nullable=False, comment="原表主键ID") admin_id = Column(Integer, comment="管理员ID") module = Column(String(50), comment="操作模块") action = Column(String(50), comment="操作动作") description = Column(String(500), comment="操作描述") old_data = Column(Text, comment="操作前数据(JSON)") new_data = Column(Text, comment="操作后数据(JSON)") ip_address = Column(String(50), comment="IP地址") is_deleted = Column(SmallInteger, default=0, comment="是否删除:0-否,1-是") created_at = Column(DateTime, comment="操作时间") his_created_at = Column(DateTime, comment="历史记录创建时间") his_operation = Column(String(10), nullable=False, comment="操作类型:INSERT/UPDATE/DELETE")