28deb8282f
- Introduced multiple new documentation files, including a complete documentation index, quick reference guides, and comprehensive analyses of the knowledge base and wiki settings. - The new files provide detailed insights into the architecture, data models, API endpoints, and implementation strategies for the knowledge base and wiki functionalities. - Enhanced navigation and usability for developers and team members by summarizing key components, configurations, and data flows related to the knowledge base system. These additions significantly improve the clarity and accessibility of documentation, supporting better onboarding and reference for current and future team members.
22 lines
1.1 KiB
SQL
22 lines
1.1 KiB
SQL
-- Migration: 000038_add_indexing_strategy
|
|
-- Description: Add indexing_strategy column to knowledge_bases table.
|
|
-- Controls which indexing pipelines are active (vector, keyword, wiki, graph).
|
|
DO $$ BEGIN RAISE NOTICE '[Migration 000038] Adding indexing_strategy column to knowledge_bases'; END $$;
|
|
|
|
ALTER TABLE knowledge_bases ADD COLUMN IF NOT EXISTS indexing_strategy JSONB;
|
|
|
|
COMMENT ON COLUMN knowledge_bases.indexing_strategy IS 'Indexing pipelines strategy: {"vector_enabled": bool, "keyword_enabled": bool, "wiki_enabled": bool, "graph_enabled": bool}';
|
|
|
|
-- Backfill: existing rows get vector+keyword=true (legacy default behavior),
|
|
-- wiki_enabled synced from wiki_config.enabled, graph_enabled synced from extract_config.enabled.
|
|
UPDATE knowledge_bases
|
|
SET indexing_strategy = jsonb_build_object(
|
|
'vector_enabled', TRUE,
|
|
'keyword_enabled', TRUE,
|
|
'wiki_enabled', COALESCE((wiki_config ->> 'enabled')::boolean, FALSE),
|
|
'graph_enabled', COALESCE((extract_config ->> 'enabled')::boolean, FALSE)
|
|
)
|
|
WHERE indexing_strategy IS NULL;
|
|
|
|
DO $$ BEGIN RAISE NOTICE '[Migration 000038] indexing_strategy column added and backfilled successfully'; END $$;
|