
- Implemented full CRUD operations for tasks - Added SQLite database with SQLAlchemy ORM - Set up Alembic migrations for database schema - Created health check and base URL endpoints - Added CORS middleware for cross-origin requests - Included comprehensive API documentation - Updated README with complete project information
15 lines
607 B
Python
15 lines
607 B
Python
from sqlalchemy import Column, Integer, String, Text, DateTime, Boolean
|
|
from sqlalchemy.sql import func
|
|
from app.db.base import Base
|
|
|
|
|
|
class Task(Base):
|
|
__tablename__ = "tasks"
|
|
|
|
id = Column(Integer, primary_key=True, index=True)
|
|
title = Column(String(200), nullable=False)
|
|
description = Column(Text, nullable=True)
|
|
completed = Column(Boolean, default=False, nullable=False)
|
|
priority = Column(String(10), default="medium", nullable=False)
|
|
created_at = Column(DateTime(timezone=True), server_default=func.now())
|
|
updated_at = Column(DateTime(timezone=True), onupdate=func.now()) |