
- Implemented user authentication with JWT tokens - Created comprehensive task management with CRUD operations - Added category system for task organization - Set up SQLite database with SQLAlchemy ORM - Configured Alembic for database migrations - Added API documentation with OpenAPI/Swagger - Implemented proper authorization and user scoping - Created health check and root endpoints - Updated README with complete documentation
18 lines
760 B
Python
18 lines
760 B
Python
from sqlalchemy import Column, Integer, String, DateTime, Boolean
|
|
from sqlalchemy.orm import relationship
|
|
from sqlalchemy.sql import func
|
|
from app.db.base import Base
|
|
|
|
class User(Base):
|
|
__tablename__ = "users"
|
|
|
|
id = Column(Integer, primary_key=True, index=True)
|
|
email = Column(String, unique=True, index=True, nullable=False)
|
|
hashed_password = Column(String, nullable=False)
|
|
full_name = Column(String, nullable=True)
|
|
is_active = Column(Boolean, default=True)
|
|
created_at = Column(DateTime(timezone=True), server_default=func.now())
|
|
updated_at = Column(DateTime(timezone=True), onupdate=func.now())
|
|
|
|
tasks = relationship("Task", back_populates="owner")
|
|
categories = relationship("Category", back_populates="owner") |