Automated Action 02e8d8dd3e Create Todo Application with FastAPI and SQLite
- Set up project structure with FastAPI
- Create Todo database model with SQLAlchemy
- Add Alembic migrations
- Implement CRUD API endpoints for todos
- Add health endpoint for application monitoring
- Add README with documentation

generated with BackendIM... (backend.im)
2025-05-14 00:44:49 +00:00

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