
- Created comprehensive task management system with CRUD operations - Implemented SQLAlchemy models and database configuration - Added Alembic migrations for database schema management - Created FastAPI endpoints for task management with proper validation - Added health check endpoint and base URL information - Configured CORS middleware and OpenAPI documentation - Updated README with comprehensive API documentation - Code formatted and linted with Ruff
19 lines
709 B
Python
19 lines
709 B
Python
from datetime import datetime
|
|
from sqlalchemy import Column, Integer, String, Text, Boolean, DateTime
|
|
from app.db.base import Base
|
|
|
|
|
|
class Task(Base):
|
|
__tablename__ = "tasks"
|
|
|
|
id = Column(Integer, primary_key=True, index=True)
|
|
title = Column(String(200), nullable=False, index=True)
|
|
description = Column(Text, nullable=True)
|
|
completed = Column(Boolean, default=False, nullable=False)
|
|
priority = Column(String(10), default="medium", nullable=False)
|
|
created_at = Column(DateTime, default=datetime.utcnow, nullable=False)
|
|
updated_at = Column(
|
|
DateTime, default=datetime.utcnow, onupdate=datetime.utcnow, nullable=False
|
|
)
|
|
due_date = Column(DateTime, nullable=True)
|