Automated Action 8e26cae20e Initial Todo app backend implementation with FastAPI and SQLite
- Created FastAPI application structure
- Added Todo model and CRUD operations
- Added database integration with SQLAlchemy
- Added migrations with Alembic
- Added health endpoint
- Added API documentation with Swagger UI and ReDoc
2025-05-16 00:35:49 +00:00

17 lines
574 B
Python

from sqlalchemy import Column, Integer, String, Boolean, DateTime
from sqlalchemy.sql import func
from .database import Base
class Todo(Base):
"""
Todo model representing a task to be done
"""
__tablename__ = "todos"
id = Column(Integer, primary_key=True, index=True)
title = Column(String, nullable=False)
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())