Automated Action 10ef945a25 Build simple Todo application with FastAPI and SQLite
- Created REST API for managing todo items
- Implemented SQLite database with SQLAlchemy ORM
- Added Alembic for database migrations
- Added health check endpoint

generated with BackendIM... (backend.im)
2025-05-13 06:22:39 +00:00

13 lines
481 B
Python

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