feat(schema): add note_version.pin_kind and pin_label

Spec: docs/superpowers/specs/2026-05-13-note-version-pinning-design.md

- pin_kind: NULL=rolling, 'auto'=stability-scan, 'manual'=user-declared.
- pin_label: NULL for rolling; auto-generated for 'auto'; user-supplied
  string for 'manual' (may be NULL).

No backfill — every existing row stays rolling. The daily auto-pin scan
will catch up on the first run after deploy.
This commit is contained in:
2026-05-13 13:55:18 -04:00
parent 90aa1f2fdb
commit 17211c6e82
2 changed files with 39 additions and 0 deletions
@@ -14,6 +14,8 @@ class NoteVersion(Base, CreatedAtMixin):
body: Mapped[str] = mapped_column(Text)
title: Mapped[str] = mapped_column(Text, default="")
tags: Mapped[list[str]] = mapped_column(ARRAY(Text), default=list)
pin_kind: Mapped[str | None] = mapped_column(Text, nullable=True)
pin_label: Mapped[str | None] = mapped_column(Text, nullable=True)
def to_dict(self, include_body: bool = True) -> dict:
d: dict = {
@@ -22,6 +24,8 @@ class NoteVersion(Base, CreatedAtMixin):
"user_id": self.user_id,
"title": self.title,
"tags": self.tags or [],
"pin_kind": self.pin_kind,
"pin_label": self.pin_label,
"created_at": self.created_at.isoformat(),
}
if include_body: