user_his.py 1.3 KB

1234567891011121314151617181920212223242526
  1. """
  2. 用户历史记录模型
  3. """
  4. from sqlalchemy import Column, Integer, String, DateTime, SmallInteger
  5. from app.database import Base
  6. class UserHis(Base):
  7. """用户表历史记录"""
  8. __tablename__ = "users_his"
  9. his_id = Column(Integer, primary_key=True, autoincrement=True, comment="历史记录主键ID")
  10. id = Column(Integer, nullable=False, comment="原表主键ID")
  11. username = Column(String(50), nullable=False, comment="用户名")
  12. password = Column(String(255), nullable=False, comment="密码(加密)")
  13. email = Column(String(100), comment="邮箱")
  14. machine_code = Column(String(64), comment="机器码")
  15. card_id = Column(Integer, comment="当前卡密ID")
  16. expire_time = Column(DateTime, comment="到期时间")
  17. last_login_time = Column(DateTime, comment="最后登录时间")
  18. last_login_ip = Column(String(50), comment="最后登录IP")
  19. status = Column(SmallInteger, default=1, comment="状态:1-正常,0-禁用")
  20. is_deleted = Column(SmallInteger, default=0, comment="是否删除:0-否,1-是")
  21. created_at = Column(DateTime, comment="创建时间")
  22. updated_at = Column(DateTime, comment="更新时间")
  23. his_created_at = Column(DateTime, comment="历史记录创建时间")
  24. his_operation = Column(String(10), nullable=False, comment="操作类型:INSERT/UPDATE/DELETE")