mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-19 14:56:09 +01:00
🎨 The data history of a database view should follow the doc history and data snapshot https://github.com/siyuan-note/siyuan/issues/9567
This commit is contained in:
parent
4ca62ef701
commit
bf6ff5bc32
5 changed files with 119 additions and 2 deletions
|
|
@ -1409,6 +1409,16 @@ func removeDoc(box *Box, p string, luteEngine *lute.Lute) {
|
|||
return
|
||||
}
|
||||
|
||||
// 关联的属性视图也要复制到历史中 https://github.com/siyuan-note/siyuan/issues/9567
|
||||
avNodes := tree.Root.ChildrenByType(ast.NodeAttributeView)
|
||||
for _, avNode := range avNodes {
|
||||
srcAvPath := filepath.Join(util.DataDir, "storage", "av", avNode.AttributeViewID+".json")
|
||||
destAvPath := filepath.Join(historyDir, "storage", "av", avNode.AttributeViewID+".json")
|
||||
if copyErr := filelock.Copy(srcAvPath, destAvPath); nil != copyErr {
|
||||
logging.LogErrorf("copy av [%s] failed: %s", srcAvPath, copyErr)
|
||||
}
|
||||
}
|
||||
|
||||
copyDocAssetsToDataAssets(box.ID, p)
|
||||
|
||||
removeIDs := treenode.RootChildIDs(tree.ID)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue