Automated Action 18f0e055cd Create simple todo app with FastAPI and SQLite
- Setup FastAPI project structure
- Create SQLAlchemy models and database connection
- Implement Alembic migrations
- Create CRUD operations for todos
- Add API endpoints for todos
- Add health endpoint
- Update README.md

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

12 lines
483 B
Python

from datetime import datetime
from sqlalchemy import Column, Integer, String, Boolean, DateTime
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, default=datetime.utcnow)
updated_at = Column(DateTime, default=datetime.utcnow, onupdate=datetime.utcnow)