mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 07:00:12 +01:00
This commit is contained in:
parent
ce50681a29
commit
7a7e9d5af2
2 changed files with 6 additions and 3 deletions
|
|
@ -18,6 +18,7 @@ package sql
|
|||
|
||||
import (
|
||||
"bytes"
|
||||
"crypto/sha256"
|
||||
"database/sql"
|
||||
"errors"
|
||||
"fmt"
|
||||
|
|
@ -1093,7 +1094,7 @@ func batchDeleteByPathPrefix(tx *sql.Tx, boxID, pathPrefix string) (err error) {
|
|||
return
|
||||
}
|
||||
|
||||
func batchUpdateHPath(tx *sql.Tx, boxID, rootID, newHPath string) (err error) {
|
||||
func batchUpdateHPath(tx *sql.Tx, boxID, rootID, newHPath string, context map[string]interface{}) (err error) {
|
||||
stmt := "UPDATE blocks SET hpath = ? WHERE box = ? AND root_id = ?"
|
||||
if err = execStmtTx(tx, stmt, newHPath, boxID, rootID); nil != err {
|
||||
return
|
||||
|
|
@ -1109,6 +1110,8 @@ func batchUpdateHPath(tx *sql.Tx, boxID, rootID, newHPath string) (err error) {
|
|||
}
|
||||
}
|
||||
ClearCache()
|
||||
evtHash := fmt.Sprintf("%x", sha256.Sum256([]byte(rootID)))[:7]
|
||||
eventbus.Publish(eventbus.EvtSQLInsertBlocksFTS, context, 1, evtHash)
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue