Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:bug: Renaming doc title does not update `title` in ial https://github.com/siyuan-note/siyuan/issues/16166

Daniel73963739ceee
diff --git a/kernel/sql/database.go b/kernel/sql/database.go
index e79dd89505..8068cff1fb 100644
--- a/kernel/sql/database.go
+++ b/kernel/sql/database.go
@@ -1256,17 +1256,18 @@ func batchDeleteByPathPrefix(tx *sql.Tx, boxID, pathPrefix string) (err error) {
}
func batchUpdatePath(tx *sql.Tx, tree *parse.Tree, context map[string]interface{}) (err error) {
- stmt := "UPDATE blocks SET box = ?, path = ?, hpath = ? WHERE root_id = ?"
- if err = execStmtTx(tx, stmt, tree.Box, tree.Path, tree.HPath, tree.ID); err != nil {
+ ialContent := treenode.IALStr(tree.Root)
+ stmt := "UPDATE blocks SET box = ?, path = ?, hpath = ?, ial = ? WHERE root_id = ?"
+ if err = execStmtTx(tx, stmt, tree.Box, tree.Path, tree.HPath, ialContent, tree.ID); err != nil {
return
}
- stmt = "UPDATE blocks_fts SET box = ?, path = ?, hpath = ? WHERE root_id = ?"
- if err = execStmtTx(tx, stmt, tree.Box, tree.Path, tree.HPath, tree.ID); err != nil {
+ stmt = "UPDATE blocks_fts SET box = ?, path = ?, hpath = ?, ial = ? WHERE root_id = ?"
+ if err = execStmtTx(tx, stmt, tree.Box, tree.Path, tree.HPath, ialContent, tree.ID); err != nil {
return
}
if !caseSensitive {
- stmt = "UPDATE blocks_fts_case_insensitive SET box = ?, path = ?, hpath = ? WHERE root_id = ?"
- if err = execStmtTx(tx, stmt, tree.Box, tree.Path, tree.HPath, tree.ID); err != nil {
+ stmt = "UPDATE blocks_fts_case_insensitive SET box = ?, path = ?, hpath = ?, ial = ? WHERE root_id = ?"
+ if err = execStmtTx(tx, stmt, tree.Box, tree.Path, tree.HPath, ialContent, tree.ID); err != nil {
return
}
}
@@ -1277,17 +1278,18 @@ func batchUpdatePath(tx *sql.Tx, tree *parse.Tree, context map[string]interface{
}
func batchUpdateHPath(tx *sql.Tx, tree *parse.Tree, context map[string]interface{}) (err error) {
- stmt := "UPDATE blocks SET hpath = ? WHERE root_id = ?"
- if err = execStmtTx(tx, stmt, tree.HPath, tree.ID); err != nil {
+ ialContent := treenode.IALStr(tree.Root)
+ stmt := "UPDATE blocks SET hpath = ?, ial = ? WHERE root_id = ?"
+ if err = execStmtTx(tx, stmt, tree.HPath, ialContent, tree.ID); err != nil {
return
}
- stmt = "UPDATE blocks_fts SET hpath = ? WHERE root_id = ?"
- if err = execStmtTx(tx, stmt, tree.HPath, tree.ID); err != nil {
+ stmt = "UPDATE blocks_fts SET hpath = ?, ial = ? WHERE root_id = ?"
+ if err = execStmtTx(tx, stmt, tree.HPath, ialContent, tree.ID); err != nil {
return
}
if !caseSensitive {
- stmt = "UPDATE blocks_fts_case_insensitive SET hpath = ? WHERE root_id = ?"
- if err = execStmtTx(tx, stmt, tree.HPath, tree.ID); err != nil {
+ stmt = "UPDATE blocks_fts_case_insensitive SET hpath = ?, ial = ? WHERE root_id = ?"
+ if err = execStmtTx(tx, stmt, tree.HPath, ialContent, tree.ID); err != nil {
return
}
}