Automated Action d667651110 Create simple Todo app with FastAPI and SQLite
- Add CRUD operations for todos (create, read, update, delete)
- Implement SQLAlchemy models and schemas
- Set up Alembic for database migrations
- Add health endpoint and CORS configuration
- Include comprehensive API documentation
- Structure project with proper separation of concerns
2025-06-19 22:02:18 +00:00

14 lines
542 B
Python

from sqlalchemy import Boolean, Column, Integer, String, 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, index=True, nullable=False)
description = Column(String, nullable=True)
completed = Column(Boolean, default=False, nullable=False)
created_at = Column(DateTime(timezone=True), server_default=func.now())
updated_at = Column(DateTime(timezone=True), onupdate=func.now())