mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 14:40:12 +01:00
🐛 Renaming doc title does not update title in ial https://github.com/siyuan-note/siyuan/issues/16166
Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
parent
b91f2cb3ad
commit
73963739ce
1 changed files with 14 additions and 12 deletions
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue