Automated Action 7a32d606f3 Create simple todo app with FastAPI and SQLite
- Setup project structure
- Create database models for todos
- Configure SQLite database connection
- Add Alembic migration scripts
- Implement CRUD API endpoints for todos
- Add health check endpoint
- Update README with documentation

generated with BackendIM... (backend.im)
2025-05-13 07:02:29 +00:00

15 lines
580 B
Python

from sqlalchemy import Column, Integer, String, Boolean, DateTime
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.sql import func
Base = declarative_base()
class Todo(Base):
__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), default=func.now())
updated_at = Column(DateTime(timezone=True), default=func.now(), onupdate=func.now())