mirror of
https://github.com/Tencent/WeKnora.git
synced 2026-10-16 15:06:29 +08:00
Folder uploads used to encode their relative directory inside file_name, which made the document list render the whole path as the title and left no way to browse or query a single folder. The directory now lives in a dedicated folder_path column (with a backfill for existing rows), the document list accepts folder_path / folder_recursive filters, and a new GET /knowledge-bases/:id/knowledge/folders endpoint returns the folder tree with per-folder document counts.
9 lines
289 B
SQL
9 lines
289 B
SQL
-- Fold the relative directory back into file_name before dropping the column.
|
|
UPDATE knowledges
|
|
SET file_name = folder_path || '/' || file_name
|
|
WHERE folder_path <> '' AND file_name <> '';
|
|
|
|
DROP INDEX IF EXISTS idx_knowledges_folder_path;
|
|
|
|
ALTER TABLE knowledges DROP COLUMN folder_path;
|