Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: Support doc/snapshot history for database table view https://github.com/siyuan-note/siyuan/issues/9567

Daniel59dcc2637a2e
diff --git a/kernel/model/history.go b/kernel/model/history.go
index 3574d499bd..dfb36cc6ae 100644
--- a/kernel/model/history.go
+++ b/kernel/model/history.go
@@ -255,8 +255,10 @@ func RollbackDocHistory(boxID, historyPath string) (err error) {
for _, avNode := range avNodes {
srcAvPath := filepath.Join(historyDir, "storage", "av", avNode.AttributeViewID+".json")
destAvPath := filepath.Join(util.DataDir, "storage", "av", avNode.AttributeViewID+".json")
- if copyErr := filelock.CopyNewtimes(srcAvPath, destAvPath); nil != copyErr {
- logging.LogErrorf("copy av [%s] failed: %s", srcAvPath, copyErr)
+ if gulu.File.IsExist(destAvPath) {
+ if copyErr := filelock.CopyNewtimes(srcAvPath, destAvPath); nil != copyErr {
+ logging.LogErrorf("copy av [%s] failed: %s", srcAvPath, copyErr)
+ }
}
}
}