Automated Action 28f6914da1 Build task manager API with FastAPI and SQLite
- Set up project structure with FastAPI
- Implement SQLAlchemy models for User and Task
- Create Alembic migrations
- Implement authentication with JWT
- Add CRUD operations for tasks
- Add task filtering and prioritization
- Configure health check endpoint
- Update README with project documentation
2025-06-17 08:37:23 +00:00

18 lines
663 B
Python

from sqlalchemy import Boolean, Column, String, DateTime
from sqlalchemy.orm import relationship
from sqlalchemy.sql import func
from app.db.base_class import Base
class User(Base):
id = Column(String, primary_key=True, index=True)
email = Column(String, unique=True, index=True, nullable=False)
hashed_password = Column(String, nullable=False)
is_active = Column(Boolean(), default=True)
created_at = Column(DateTime, server_default=func.now())
updated_at = Column(DateTime, server_default=func.now(), onupdate=func.now())
# Relationships
tasks = relationship("Task", back_populates="owner", cascade="all, delete-orphan")