
- Set up project structure with proper directory layout - Implemented SQLite database with SQLAlchemy ORM - Created Todo model with CRUD operations - Added Alembic for database migrations - Implemented RESTful API endpoints for todos - Added health check endpoint - Configured CORS for all origins - Created comprehensive documentation - Added linting with Ruff
13 lines
517 B
Python
13 lines
517 B
Python
from sqlalchemy import Column, Integer, String, Boolean, DateTime
|
|
from sqlalchemy.sql import func
|
|
from app.db.base import 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), server_default=func.now())
|
|
updated_at = Column(DateTime(timezone=True), onupdate=func.now()) |