
- Created project structure and FastAPI application - Added SQLite database models and Pydantic schemas - Implemented todo routes (add, list, delete) - Set up Alembic migrations - Added health endpoint generated with BackendIM... (backend.im)
15 lines
539 B
Python
15 lines
539 B
Python
from sqlalchemy import Column, Integer, String, Boolean, DateTime
|
|
from sqlalchemy.sql import func
|
|
from app.database.database import Base
|
|
|
|
class Todo(Base):
|
|
"""
|
|
Todo model representing a task in the todo list
|
|
"""
|
|
__tablename__ = "todos"
|
|
|
|
id = Column(Integer, primary_key=True, index=True)
|
|
title = Column(String, index=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()) |