Automated Action 2c24afcb6c Create simple FastAPI todo application
- Add project structure with FastAPI, SQLAlchemy, and Alembic
- Implement Todo model with CRUD operations
- Add REST API endpoints for todo management
- Configure SQLite database with migrations
- Include health check and API documentation endpoints
- Add CORS middleware for all origins
- Format code with Ruff
2025-06-18 00:30:05 +00:00

16 lines
526 B
Python

from sqlalchemy import Column, Integer, String, Boolean, DateTime
from sqlalchemy.sql import func
from app.db.base import Base
class Todo(Base):
__tablename__ = "todos"
id = Column(Integer, primary_key=True, index=True)
title = Column(String(200), nullable=False)
description = Column(String(500), nullable=True)
completed = Column(Boolean, default=False)
created_at = Column(DateTime(timezone=True), server_default=func.now())
updated_at = Column(DateTime(timezone=True), onupdate=func.now())