Automated Action af063c97fc Create Todo app with FastAPI and SQLite
- Set up project structure with FastAPI and SQLAlchemy
- Create Todo model with CRUD operations
- Implement database migrations with Alembic
- Add health endpoint and API documentation
- Create comprehensive README

generated with BackendIM... (backend.im)
2025-05-13 17:36:33 +00:00

15 lines
536 B
Python

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