Automated Action e1ed70e281 Create FastAPI Todo API application
- Set up project structure and requirements
- Create database models and connection
- Set up Alembic for migrations
- Implement CRUD operations for todos
- Build RESTful API endpoints
- Update README with project documentation

generated with BackendIM... (backend.im)
2025-05-11 19:49:50 +00:00

14 lines
495 B
Python

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