- Widen priority badge from w-10 to w-14 to fit "medium" text, add "none" case - Guard against null end_datetime in event update validation - Exclude current event from this_and_future DELETE to prevent 404 - Use Python-side datetime.now for comment timestamps (avoids UTC offset) - Hide "Add subtask" button when viewing a subtask (prevents nested nesting) - Add X close button to TaskDetailPanel header on desktop Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
19 lines
697 B
Python
19 lines
697 B
Python
from sqlalchemy import Text, Integer, ForeignKey
|
|
from sqlalchemy.orm import Mapped, mapped_column, relationship as sa_relationship
|
|
from datetime import datetime
|
|
from app.database import Base
|
|
|
|
|
|
class TaskComment(Base):
|
|
__tablename__ = "task_comments"
|
|
|
|
id: Mapped[int] = mapped_column(primary_key=True, index=True)
|
|
task_id: Mapped[int] = mapped_column(
|
|
Integer, ForeignKey("project_tasks.id", ondelete="CASCADE"), nullable=False, index=True
|
|
)
|
|
content: Mapped[str] = mapped_column(Text, nullable=False)
|
|
created_at: Mapped[datetime] = mapped_column(default=datetime.now)
|
|
|
|
# Relationships
|
|
task: Mapped["ProjectTask"] = sa_relationship(back_populates="comments")
|