Phase 3: Graph view, backlinks, quick switcher, export
- Add outgoing_links (JSON) and backlinks_count to Document model
- POST /documents/{id}/detect-links — detect [[uuid]] patterns in content
- GET /documents/{id}/backlinks — documents referencing this doc
- GET /documents/{id}/outgoing-links — documents this doc references
- GET /documents/{id}/links — combined incoming + outgoing
- GET /projects/{id}/graph — full project relationship graph
- GET /search/quick — fuzzy search (Quick Switcher Cmd+K)
- GET /projects/{id}/documents/search — project-scoped search
- GET /documents/{id}/export — markdown|json export
- GET /projects/{id}/export — json|zip export
- 27 new tests
This commit is contained in:
@@ -39,3 +39,6 @@ class Document(Base):
|
||||
reasoning_steps: Mapped[str | None] = mapped_column(Text, nullable=True) # JSON array as text
|
||||
model_source: Mapped[str | None] = mapped_column(String(100), nullable=True)
|
||||
tiptap_content: Mapped[str | None] = mapped_column(Text, nullable=True) # JSON object as text
|
||||
# Phase 3: Link tracking
|
||||
outgoing_links: Mapped[str] = mapped_column(Text, nullable=False, default="[]") # JSON array of document IDs
|
||||
backlinks_count: Mapped[int] = mapped_column(default=0, nullable=False) # Cached count of incoming links
|
||||
|
||||
Reference in New Issue
Block a user