feat(fts): backfill search_vector for all existing documents (V35)

Fires the BEFORE UPDATE trigger for every documents row, which recomputes
the tsvector from all currently-linked metadata, blocks, receivers, and tags.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Marcel
2026-04-14 23:47:45 +02:00
parent 7d456d8e8b
commit 7ec3e6170d

View File

@@ -0,0 +1,6 @@
-- Backfill search_vector for all existing documents.
-- The BEFORE UPDATE trigger (trg_documents_fts, installed by V34) recomputes
-- the full vector from title, summary, transcription blocks, sender/receiver
-- names, tags, and location. At backfill time all join tables already contain
-- data, so "SET title = title" is sufficient to fire the trigger for every row.
UPDATE documents SET title = title;