diff --git a/backend/src/main/resources/db/migration/V35__backfill_fts_search_vector.sql b/backend/src/main/resources/db/migration/V35__backfill_fts_search_vector.sql new file mode 100644 index 00000000..a8f15f9b --- /dev/null +++ b/backend/src/main/resources/db/migration/V35__backfill_fts_search_vector.sql @@ -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;