account.py 787 B

1234567891011121314151617181920
  1. from sqlalchemy import Column, Integer, String, Text, Float, JSON, TIMESTAMP, Enum
  2. from sqlalchemy.sql import func
  3. from sqlalchemy.ext.declarative import declarative_base
  4. from app.core.database import Base
  5. class Account(Base):
  6. __tablename__ = "account"
  7. id = Column(Integer, primary_key=True, index=True)
  8. pool_name = Column(String(50), nullable=False, index=True)
  9. username = Column(String(100), nullable=False)
  10. password = Column(String(255), nullable=True)
  11. extra_data = Column(JSON, nullable=True)
  12. # 锁定截止时间戳 (0 表示未锁定,> time.time() 表示锁定中)
  13. lock_until = Column(Float, default=0, index=True)
  14. # 状态: active, disabled, removed
  15. status = Column(
  16. Enum('active','disable'), default="active", index=True)