
- Set up FastAPI application with CORS support - Created SQLAlchemy models for task management - Implemented CRUD operations for tasks - Added database migrations with Alembic - Created REST API endpoints for task operations - Added health check endpoint - Updated README with comprehensive documentation - Applied code formatting with Ruff
14 lines
622 B
Python
14 lines
622 B
Python
from sqlalchemy import Column, Integer, String, Boolean, DateTime, Text
|
|
from sqlalchemy.sql import func
|
|
from app.db.base import Base
|
|
|
|
class Task(Base):
|
|
__tablename__ = "tasks"
|
|
|
|
id = Column(Integer, primary_key=True, index=True)
|
|
title = Column(String(255), nullable=False, index=True)
|
|
description = Column(Text, nullable=True)
|
|
completed = Column(Boolean, default=False, nullable=False)
|
|
priority = Column(String(20), default="medium", nullable=False)
|
|
created_at = Column(DateTime(timezone=True), server_default=func.now())
|
|
updated_at = Column(DateTime(timezone=True), onupdate=func.now()) |