Automated Action b5638b4c86 Add Simple Todo Application with FastAPI and SQLite
- Create project structure with FastAPI setup
- Implement Todo model with SQLAlchemy
- Set up database migrations with Alembic
- Create CRUD API endpoints for Todo items
- Add health endpoint for application monitoring
- Update README with documentation

generated with BackendIM... (backend.im)
2025-05-13 05:10:03 +00:00

12 lines
514 B
Python

from sqlalchemy import Column, Integer, String, Boolean, DateTime
from sqlalchemy.sql import func
from app.db.base_class import Base
class Todo(Base):
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(timezone=True), server_default=func.now())
updated_at = Column(DateTime(timezone=True), server_default=func.now(), onupdate=func.now())