Automated Action ae91c493c6 Add FastAPI todo application with SQLite database
- Implement CRUD operations for todos
- Add FastAPI with CORS middleware
- Set up SQLite database with Alembic migrations
- Include health endpoint and API documentation
- Configure Ruff for code linting
- Update README with comprehensive documentation
2025-06-17 07:03:02 +00:00

14 lines
542 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, 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())