Automated Action e852047583 Create Todo application with FastAPI and SQLite
- Implemented project structure
- Added SQLAlchemy models and database connection
- Created Alembic migrations
- Implemented CRUD API endpoints
- Added health endpoint
- Updated README.md

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

13 lines
512 B
Python

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