
- Set up project structure - Configure SQLite database connection - Create Todo model and schema - Implement CRUD API endpoints for todo items - Add health check endpoint - Update README with documentation generated with BackendIM... (backend.im)
15 lines
597 B
Python
15 lines
597 B
Python
from sqlalchemy import Column, Integer, String, Boolean, DateTime, func
|
|
from sqlalchemy.ext.declarative import declared_attr
|
|
from sqlalchemy.ext.declarative import declarative_base
|
|
|
|
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, server_default=func.now())
|
|
updated_at = Column(DateTime, server_default=func.now(), onupdate=func.now()) |