user.py 426 B

123456789101112131415
  1. from sqlalchemy import Boolean, Column, String, Integer
  2. from sqlalchemy.orm import relationship
  3. from app.db.session import Base
  4. class User(Base):
  5. __tablename__ = "users"
  6. id = Column(Integer, primary_key=True, index=True)
  7. email = Column(String, unique=True, index=True)
  8. hashed_password = Column(String)
  9. is_active = Column(Boolean, default=True)
  10. items = relationship("Item", back_populates="owner")