chore: 初始化仓库,导入项目基线代码
Academy v0.8.3 完整代码基线:Go 后端(internal/cmd/cli/mcp-server/docreader)、 Vue 前端(frontend)、数据库迁移(migrations)、部署编排(docker/helm/deploy)与文档。 今日开发的培训推送管理改动随后单独提交。
This commit is contained in:
commit
7ec21f35b0
5767 files changed
+1436788
No files matched your search
@@ -0,0 +1,21 @@
|
||||
-- Folder tree support for knowledge bases.
|
||||
--
|
||||
-- Folder uploads used to encode their relative directory inside file_name
|
||||
-- (e.g. "docs/spec/design.md"), which made the document list show the whole
|
||||
-- path as the title and left no way to query a single folder. The path now
|
||||
-- lives in its own column and file_name keeps only the base name.
|
||||
ALTER TABLE knowledges
|
||||
ADD COLUMN IF NOT EXISTS folder_path VARCHAR(1024) NOT NULL DEFAULT '';
|
||||
|
||||
-- Backfill legacy folder uploads so existing knowledge bases render the same
|
||||
-- tree as newly uploaded folders.
|
||||
UPDATE knowledges
|
||||
SET folder_path = LEFT(
|
||||
REGEXP_REPLACE(file_name, '/[^/]*$', ''),
|
||||
1024
|
||||
),
|
||||
file_name = REGEXP_REPLACE(file_name, '^.*/', '')
|
||||
WHERE file_name LIKE '%/%';
|
||||
|
||||
CREATE INDEX IF NOT EXISTS idx_knowledges_folder_path
|
||||
ON knowledges (tenant_id, knowledge_base_id, folder_path);
|
||||
Reference in new issue
Block a user