Automated Action 7fa5fb0213 Setup complete Todo API with FastAPI and SQLite
- Create Todo model and schemas
- Set up API endpoints for CRUD operations
- Configure SQLAlchemy for database access
- Set up Alembic for database migrations
- Add Ruff for code linting
- Update README with project documentation
2025-05-27 06:32:35 +00:00

24 lines
589 B
Python

"""
Todo model module.
"""
from datetime import datetime
from sqlalchemy import Boolean, Column, DateTime, Integer, String, Text
from app.db.base_class import Base
class Todo(Base):
"""
Todo model.
"""
id = Column(Integer, primary_key=True, index=True)
title = Column(String(255), nullable=False)
description = Column(Text, nullable=True)
completed = Column(Boolean, default=False)
created_at = Column(DateTime, default=datetime.utcnow)
updated_at = Column(
DateTime,
default=datetime.utcnow,
onupdate=datetime.utcnow
)