Files
Enterprise-Knowledge-Base/migrations/versioned/000013_add_chunk_status_and_hash.up.sql
T
wizardchen e56233ef11 feat: Enhance chunk management and FAQ import functionality
- Updated chunk repository methods to support deletion of unindexed chunks and listing all FAQ chunks by knowledge ID.
- Introduced batch update functionality for chunks in the chunk service.
- Enhanced FAQ import logic to handle append and replace operations, improving efficiency and data integrity.
- Added content hash calculation for FAQ entries to facilitate quick matching and deduplication.
- Refactored related methods to streamline the import process and improve logging for better tracking of import tasks.
2025-11-24 15:47:42 +08:00

19 lines
528 B
PL/PgSQL

-- 000013_add_chunk_status_and_hash.up.sql
-- Add status and content_hash fields to chunks table
BEGIN;
-- Add status field to track chunk processing state
ALTER TABLE chunks
ADD COLUMN IF NOT EXISTS status INT NOT NULL DEFAULT 0;
-- Add content_hash field for quick content matching (primarily for FAQ)
ALTER TABLE chunks
ADD COLUMN IF NOT EXISTS content_hash VARCHAR(64);
-- Create index on content_hash for efficient lookup
CREATE INDEX IF NOT EXISTS idx_chunks_content_hash
ON chunks(content_hash);
COMMIT;