
- Created requirements.txt with necessary dependencies - Set up FastAPI application structure with main.py - Added health endpoint - Configured SQLAlchemy with SQLite database - Initialized Alembic for database migrations - Created Todo model and API endpoints - Updated README with setup and usage instructions - Linted code with Ruff
13 lines
505 B
Python
13 lines
505 B
Python
from sqlalchemy import Boolean, Column, Integer, String, DateTime
|
|
from sqlalchemy.sql import func
|
|
from .config 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()) |