
- Set up FastAPI project structure - Create Task model with SQLAlchemy - Set up Alembic for migrations - Create CRUD operations for tasks - Implement API endpoints for tasks - Add health check endpoint - Update documentation generated with BackendIM... (backend.im)
15 lines
623 B
Python
15 lines
623 B
Python
from sqlalchemy import Column, Integer, String, Boolean, DateTime, Text
|
|
from sqlalchemy.sql import func
|
|
|
|
from app.db.base_class import Base
|
|
|
|
|
|
class Task(Base):
|
|
id = Column(Integer, primary_key=True, index=True)
|
|
title = Column(String(255), nullable=False)
|
|
description = Column(Text, nullable=True)
|
|
is_completed = Column(Boolean, default=False)
|
|
priority = Column(Integer, default=1) # 1 = Low, 2 = Medium, 3 = High
|
|
due_date = Column(DateTime, nullable=True)
|
|
created_at = Column(DateTime, server_default=func.now())
|
|
updated_at = Column(DateTime, server_default=func.now(), onupdate=func.now()) |