fix: guard pg_search update with skip_embedding

This commit is contained in:
Dounx
2026-03-19 21:14:49 +08:00
committed by lyingbug
parent 954c994b61
commit 838a49601c
2 changed files with 18 additions and 2 deletions
@@ -1,6 +1,14 @@
-- Migration: Create "未分类" tag for each knowledge base that has untagged entries
-- and update chunks, knowledges, and embeddings to reference the new tag
ALTER EXTENSION pg_search UPDATE;
DO $$
BEGIN
IF current_setting('app.skip_embedding', true) = 'true' THEN
RAISE NOTICE 'Skipping pg_search update (app.skip_embedding=true)';
RETURN;
END IF;
ALTER EXTENSION pg_search UPDATE;
END $$;
DO $$
DECLARE
@@ -1,4 +1,12 @@
-- Migration 000011: Update pg_search extension to latest version
-- Equivalent to: psql -c 'ALTER EXTENSION pg_search UPDATE;'
ALTER EXTENSION pg_search UPDATE;
DO $$
BEGIN
IF current_setting('app.skip_embedding', true) = 'true' THEN
RAISE NOTICE 'Skipping pg_search update (app.skip_embedding=true)';
RETURN;
END IF;
ALTER EXTENSION pg_search UPDATE;
END $$;