user.py 760 B

1234567891011121314151617
  1. import datetime
  2. from sqlalchemy import Boolean, Column, String
  3. from sqlalchemy.sql.sqltypes import DateTime, Integer
  4. from app.db.base_class import Base
  5. class users(Base):
  6. id = Column(Integer, primary_key=True, nullable=False)
  7. userid = Column(String(200), unique=True)
  8. useraddress = Column(String(200), unique=True)
  9. email = Column(String(100), unique=True, nullable=False)
  10. hashed_password = Column(String(100))
  11. account = Column(String(100))
  12. is_active = Column(Boolean(), default=True)
  13. is_superuser = Column(Boolean(), default=False)
  14. created_at = Column(DateTime, default=datetime.datetime.now, nullable=False)
  15. updated_at = Column(DateTime, default=datetime.datetime.now, nullable=False, onupdate=datetime.datetime.now)