
- Setup project structure and dependencies - Create Todo model and SQLAlchemy database connection - Set up Alembic for database migrations - Implement CRUD operations and API endpoints - Add health check endpoint - Update README with project documentation generated with BackendIM... (backend.im)
16 lines
553 B
Python
16 lines
553 B
Python
from sqlalchemy import Column, Integer, String, Boolean, DateTime
|
|
from sqlalchemy.sql import func
|
|
from app.database import Base
|
|
|
|
|
|
class Todo(Base):
|
|
"""Todo model for the database."""
|
|
|
|
__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(timezone=True), default=func.now())
|
|
updated_at = Column(DateTime(timezone=True), default=func.now(), onupdate=func.now()) |