24 lines
1.0 KiB
Python
24 lines
1.0 KiB
Python
"""SQLAlchemy models for the kanban board."""
|
|
|
|
from datetime import datetime
|
|
from sqlalchemy import Column, Integer, String, Text, DateTime, Float
|
|
from app.database import Base
|
|
|
|
|
|
class Task(Base):
|
|
"""Task model for kanban board."""
|
|
|
|
__tablename__ = "tasks"
|
|
|
|
id = Column(Integer, primary_key=True, index=True)
|
|
title = Column(String(255), nullable=False, index=True)
|
|
description = Column(Text, nullable=True)
|
|
priority = Column(String(50), nullable=False, default="medium") # low, medium, high, urgent
|
|
status = Column(String(50), nullable=False, default="TODO", index=True) # TODO, IN PROGRESS, QA, UAT, PROD
|
|
assignee = Column(String(255), nullable=True)
|
|
tags = Column(String(500), nullable=True) # Comma-separated tags
|
|
time_estimate = Column(Float, nullable=True) # Hours
|
|
due_date = Column(DateTime, nullable=True)
|
|
created_at = Column(DateTime, nullable=False, default=datetime.utcnow)
|
|
updated_at = Column(DateTime, nullable=False, default=datetime.utcnow, onupdate=datetime.utcnow)
|