Automated Action 8ffce8f5fe Implement todo application with FastAPI and SQLite
- Set up project structure with FastAPI
- Create SQLite database models with SQLAlchemy
- Implement Alembic for migrations
- Create API endpoints for todo operations
- Add health check endpoint
- Update README.md with comprehensive documentation

generated with BackendIM... (backend.im)
2025-05-13 04:46:37 +00:00

13 lines
525 B
Python

from sqlalchemy import Column, Integer, String, Boolean, DateTime, func
from sqlalchemy.ext.declarative import declarative_base
from app.db.session import Base
class Todo(Base):
__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, default=func.now())
updated_at = Column(DateTime, default=func.now(), onupdate=func.now())