mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-02-28 05:32:52 +00:00
⚡ Optimize document moving and renaming performance https://github.com/siyuan-note/siyuan/issues/10560
This commit is contained in:
@@ -1211,18 +1211,18 @@ func batchDeleteByPathPrefix(tx *sql.Tx, boxID, pathPrefix string) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
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 {
|
||||
func batchUpdateHPath(tx *sql.Tx, rootID, newHPath string, context map[string]interface{}) (err error) {
|
||||
stmt := "UPDATE blocks SET hpath = ? WHERE root_id = ?"
|
||||
if err = execStmtTx(tx, stmt, newHPath, rootID); nil != err {
|
||||
return
|
||||
}
|
||||
stmt = "UPDATE blocks_fts SET hpath = ? WHERE box = ? AND root_id = ?"
|
||||
if err = execStmtTx(tx, stmt, newHPath, boxID, rootID); nil != err {
|
||||
stmt = "UPDATE blocks_fts SET hpath = ? WHERE root_id = ?"
|
||||
if err = execStmtTx(tx, stmt, newHPath, rootID); nil != err {
|
||||
return
|
||||
}
|
||||
if !caseSensitive {
|
||||
stmt = "UPDATE blocks_fts_case_insensitive SET hpath = ? WHERE box = ? AND root_id = ?"
|
||||
if err = execStmtTx(tx, stmt, newHPath, boxID, rootID); nil != err {
|
||||
stmt = "UPDATE blocks_fts_case_insensitive SET hpath = ? WHERE root_id = ?"
|
||||
if err = execStmtTx(tx, stmt, newHPath, rootID); nil != err {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user