
- Set up project structure - Configure SQLAlchemy models and database connection - Set up Alembic for database migrations - Create Pydantic schemas for API data validation - Implement task CRUD operations - Add task filtering and pagination - Include health check endpoint - Update README with setup and usage instructions
18 lines
713 B
Python
18 lines
713 B
Python
from datetime import datetime
|
|
from sqlalchemy import Column, Integer, String, Text, DateTime, Boolean
|
|
|
|
from app.database.base_class import Base
|
|
|
|
|
|
class Task(Base):
|
|
"""Task database model."""
|
|
|
|
id = Column(Integer, primary_key=True, index=True)
|
|
title = Column(String(255), index=True, nullable=False)
|
|
description = Column(Text, nullable=True)
|
|
status = Column(String(50), default="pending", index=True)
|
|
priority = Column(String(50), default="medium")
|
|
due_date = Column(DateTime, nullable=True)
|
|
completed = Column(Boolean, default=False)
|
|
created_at = Column(DateTime, default=datetime.utcnow)
|
|
updated_at = Column(DateTime, default=datetime.utcnow, onupdate=datetime.utcnow) |