""" 管理员历史记录模型 """ from sqlalchemy import Column, Integer, String, DateTime, SmallInteger from app.database import Base class AdminHis(Base): """管理员表历史记录""" __tablename__ = "admins_his" his_id = Column(Integer, primary_key=True, autoincrement=True, comment="历史记录主键ID") id = Column(Integer, nullable=False, comment="原表主键ID") username = Column(String(50), nullable=False, comment="管理员用户名") password = Column(String(255), nullable=False, comment="密码(加密)") real_name = Column(String(50), comment="真实姓名") email = Column(String(100), comment="邮箱") role = Column(String(20), default="admin", comment="角色") last_login_time = Column(DateTime, comment="最后登录时间") last_login_ip = Column(String(50), comment="最后登录IP") status = Column(SmallInteger, default=1, comment="状态:1-正常,0-禁用") 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")