|
@@ -30,6 +30,7 @@ import (
|
|
|
"github.com/88250/lute/parse"
|
|
|
"github.com/siyuan-note/filelock"
|
|
|
"github.com/siyuan-note/logging"
|
|
|
+ "github.com/siyuan-note/siyuan/kernel/av"
|
|
|
"github.com/siyuan-note/siyuan/kernel/filesys"
|
|
|
"github.com/siyuan-note/siyuan/kernel/sql"
|
|
|
"github.com/siyuan-note/siyuan/kernel/task"
|
|
@@ -105,6 +106,23 @@ func resetTree(tree *parse.Tree, titleSuffix string) {
|
|
|
}
|
|
|
return ast.WalkContinue
|
|
|
})
|
|
|
+
|
|
|
+ var attrViewIDs []string
|
|
|
+ // 绑定镜像数据库
|
|
|
+ ast.Walk(tree.Root, func(n *ast.Node, entering bool) ast.WalkStatus {
|
|
|
+ if !entering {
|
|
|
+ return ast.WalkContinue
|
|
|
+ }
|
|
|
+
|
|
|
+ if ast.NodeAttributeView == n.Type {
|
|
|
+ av.UpsertBlockRel(n.AttributeViewID, n.ID)
|
|
|
+ attrViewIDs = append(attrViewIDs, n.AttributeViewID)
|
|
|
+ }
|
|
|
+ return ast.WalkContinue
|
|
|
+ })
|
|
|
+
|
|
|
+ // 清空文档绑定的数据库
|
|
|
+ tree.Root.RemoveIALAttr(av.NodeAttrNameAvs)
|
|
|
}
|
|
|
|
|
|
func pagedPaths(localPath string, pageSize int) (ret map[int][]string) {
|