Automated Action 43ed4aaa3f Create simple todo application with FastAPI and SQLite
- Set up project structure with FastAPI and SQLite
- Created Todo model with SQLAlchemy ORM
- Added CRUD operations for todos
- Implemented API endpoints for Todo operations
- Added health check endpoint
- Added Alembic for database migrations
- Updated README with documentation

generated with BackendIM... (backend.im)
2025-05-13 12:04:52 +00:00

13 lines
500 B
Python

from sqlalchemy import Column, Integer, String, Boolean, DateTime
from sqlalchemy.sql import func
from app.database.base 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())