steam_account_his.py 1012 B

123456789101112131415161718192021
  1. """
  2. Steam账号历史记录模型(与主表精简版一致)
  3. """
  4. from sqlalchemy import Column, Integer, String, DateTime, SmallInteger
  5. from app.database import Base
  6. class SteamAccountHis(Base):
  7. """Steam账号绑定表历史记录"""
  8. __tablename__ = "steam_accounts_his"
  9. id = Column(Integer, primary_key=True, comment="原表主键ID")
  10. user_id = Column(Integer, nullable=False, comment="用户ID")
  11. steam_username = Column(String(100), nullable=False, comment="Steam用户名")
  12. steam_id = Column(String(50), comment="Steam ID")
  13. is_active = Column(SmallInteger, default=1, comment="是否启用")
  14. is_deleted = Column(SmallInteger, default=0, comment="是否删除")
  15. created_at = Column(DateTime, comment="绑定时间")
  16. updated_at = Column(DateTime, comment="更新时间")
  17. his_created_at = Column(DateTime, primary_key=True, comment="历史记录创建时间")
  18. his_operation = Column(String(10), nullable=False, comment="操作类型:INSERT/UPDATE/DELETE")