Automated Action 264e7b36d7 Create Todo application with FastAPI
- Set up project structure and dependencies
- Create Todo model with SQLAlchemy
- Implement CRUD operations for todos
- Create API endpoints for todos
- Set up Alembic migrations
- Update documentation

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

14 lines
513 B
Python

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