Automated Action 8a1b373ff6 feat: Implement Todo API with FastAPI and SQLite
- Setup project structure and dependencies
- Create Todo model and SQLAlchemy database connection
- Set up Alembic for database migrations
- Implement CRUD operations and API endpoints
- Add health check endpoint
- Update README with project documentation

generated with BackendIM... (backend.im)
2025-05-12 10:11:52 +00:00

16 lines
553 B
Python

from sqlalchemy import Column, Integer, String, Boolean, DateTime
from sqlalchemy.sql import func
from app.database import Base
class Todo(Base):
"""Todo model for the database."""
__tablename__ = "todos"
id = Column(Integer, primary_key=True, index=True)
title = Column(String, index=True)
description = Column(String)
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())