fix: guard pg_search update with skip_embedding
This commit is contained in:
@@ -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 $$;
|
||||
|
||||
Reference in New Issue
Block a user