Automated Action 9505ec13a1 Implement simple todo application with FastAPI and SQLite
- Set up project structure and FastAPI app
- Create database models and SQLAlchemy connection
- Implement Alembic migration scripts
- Add CRUD API endpoints for Todo items
- Add health check endpoint
- Set up validation, error handling, and middleware
- Add comprehensive documentation in README.md
2025-05-18 12:42:38 +00:00

19 lines
559 B
Python

from sqlalchemy import Boolean, Column, DateTime, Integer, String
from sqlalchemy.sql import func
from app.models.base import Base
class Todo(Base):
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)
created_at = Column(DateTime, default=func.now(), nullable=False)
updated_at = Column(
DateTime,
default=func.now(),
onupdate=func.now(),
nullable=False
)