mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 07:00:12 +01:00
This commit is contained in:
parent
c88268fbfd
commit
3a36def366
9 changed files with 22 additions and 25 deletions
|
|
@ -1097,18 +1097,18 @@ func batchDeleteByPathPrefix(tx *sql.Tx, boxID, pathPrefix string) (err error) {
|
|||
return
|
||||
}
|
||||
|
||||
func batchUpdateHPath(tx *sql.Tx, boxID, rootID, oldHPath, newHPath string) (err error) {
|
||||
stmt := "UPDATE blocks SET hpath = ? WHERE box = ? AND root_id = ? AND hpath = ?"
|
||||
if err = execStmtTx(tx, stmt, newHPath, boxID, rootID, oldHPath); nil != err {
|
||||
func batchUpdateHPath(tx *sql.Tx, boxID, rootID, newHPath string) (err error) {
|
||||
stmt := "UPDATE blocks SET hpath = ? WHERE box = ? AND root_id = ?"
|
||||
if err = execStmtTx(tx, stmt, newHPath, boxID, rootID); nil != err {
|
||||
return
|
||||
}
|
||||
stmt = "UPDATE blocks_fts SET hpath = ? WHERE box = ? AND root_id = ? AND hpath = ?"
|
||||
if err = execStmtTx(tx, stmt, newHPath, boxID, rootID, oldHPath); nil != err {
|
||||
stmt = "UPDATE blocks_fts SET hpath = ? WHERE box = ? AND root_id = ?"
|
||||
if err = execStmtTx(tx, stmt, newHPath, boxID, rootID); nil != err {
|
||||
return
|
||||
}
|
||||
if !caseSensitive {
|
||||
stmt = "UPDATE blocks_fts_case_insensitive SET hpath = ? WHERE box = ? AND root_id = ? AND hpath = ?"
|
||||
if err = execStmtTx(tx, stmt, newHPath, boxID, rootID, oldHPath); nil != err {
|
||||
stmt = "UPDATE blocks_fts_case_insensitive SET hpath = ? WHERE box = ? AND root_id = ?"
|
||||
if err = execStmtTx(tx, stmt, newHPath, boxID, rootID); nil != err {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue