Automated Action 2204ae214d Create a simple Todo app with FastAPI and SQLite
- Set up project structure and FastAPI application
- Create Todo database model with SQLAlchemy
- Configure Alembic for database migrations
- Implement CRUD endpoints for managing Todo items
- Add health check endpoint
- Include comprehensive documentation in README.md
- Configure and apply Ruff linting
2025-05-19 13:36:18 +00:00

18 lines
569 B
Python

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