feat(schema): add note.description and note.consolidated_at
Spec: docs/superpowers/specs/2026-05-13-task-as-durable-record-design.md - description: user-stated goal / initial context for tasks (NULL for knowledge notes). - consolidated_at: timestamp of the most recent auto-summary pass (NULL until first consolidation). - Migration 0044 backfills description from body for existing rows where status IS NOT NULL (i.e. tasks). Body left in place; first consolidation pass will overwrite it.
This commit is contained in:
@@ -32,6 +32,10 @@ class Note(Base, TimestampMixin):
|
||||
)
|
||||
title: Mapped[str] = mapped_column(Text, default="")
|
||||
body: Mapped[str] = mapped_column(Text, default="")
|
||||
description: Mapped[str | None] = mapped_column(Text, nullable=True)
|
||||
consolidated_at: Mapped[datetime | None] = mapped_column(
|
||||
DateTime(timezone=True), nullable=True
|
||||
)
|
||||
tags: Mapped[list[str]] = mapped_column(ARRAY(Text), default=list)
|
||||
parent_id: Mapped[int | None] = mapped_column(
|
||||
Integer, ForeignKey("notes.id", ondelete="SET NULL"), nullable=True
|
||||
@@ -81,6 +85,10 @@ class Note(Base, TimestampMixin):
|
||||
"id": self.id,
|
||||
"title": self.title,
|
||||
"body": self.body,
|
||||
"description": self.description,
|
||||
"consolidated_at": (
|
||||
self.consolidated_at.isoformat() if self.consolidated_at else None
|
||||
),
|
||||
"tags": self.tags or [],
|
||||
"parent_id": self.parent_id,
|
||||
"project_id": self.project_id,
|
||||
|
||||
Reference in New Issue
Block a user