Automated Action 6d123e4b89 Create simple todo app with FastAPI and SQLite
- Set up project structure
- Create database models with SQLAlchemy
- Add Alembic migrations
- Implement CRUD API endpoints
- Update README with documentation

generated with BackendIM... (backend.im)
2025-05-14 01:42:06 +00:00

13 lines
513 B
Python

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