Automated Action e84ae05b4e Implement simple Todo application with FastAPI and SQLite
- Set up project structure
- Configure SQLite database connection
- Create Todo model and schema
- Implement CRUD API endpoints for todo items
- Add health check endpoint
- Update README with documentation

generated with BackendIM... (backend.im)
2025-05-13 11:24:31 +00:00

15 lines
597 B
Python

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