Automated Action 512d53de73 Create simple Todo application with FastAPI and SQLite
- Created CRUD operations for todos
- Added database models and SQLAlchemy integration
- Set up Alembic for database migrations
- Added health endpoint
- Updated README with installation and usage instructions

generated with BackendIM... (backend.im)
2025-05-12 10:34:56 +00:00

13 lines
510 B
Python

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