An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:art: Add Rollup column to database table view https://github.com/siyuan-note/siyuan/issues/9958
Daniel3d3b2df07ac5
diff --git a/kernel/model/import.go b/kernel/model/import.goindex 04116b3060..ffb1d1e418 100644--- a/kernel/model/import.go+++ b/kernel/model/import.go@@ -217,30 +217,32 @@ func ImportSY(zipPath, boxID, toPath string) (err error) {newPath := filepath.Join(filepath.Dir(path), newAvID+".json")renameAvPaths[path] = newPathavIDs[oldAvID] = newAvID+ return nil+ })- // 将数据库文件中的块 ID 替换为新的块 ID- data, readErr := os.ReadFile(path)+ // 重命名数据库文件+ for oldPath, newPath := range renameAvPaths {+ data, readErr := os.ReadFile(oldPath)if nil != readErr {- logging.LogErrorf("read av file [%s] failed: %s", path, readErr)+ logging.LogErrorf("read av file [%s] failed: %s", oldPath, readErr)return nil}- var newData []byte- newData = data- for oldID, newID := range avBlockIDs {- newData = bytes.ReplaceAll(newData, []byte(oldID), []byte(newID))++ // 将数据库文件中的块 ID 替换为新的块 ID+ newData := data+ for oldAvID, newAvID := range avIDs {+ for oldID, newID := range avBlockIDs {+ newData = bytes.ReplaceAll(newData, []byte(oldID), []byte(newID))+ }+ newData = bytes.ReplaceAll(newData, []byte(oldAvID), []byte(newAvID))}- newData = bytes.ReplaceAll(newData, []byte(oldAvID), []byte(newAvID))if !bytes.Equal(data, newData) {- if writeErr := os.WriteFile(path, newData, 0644); nil != writeErr {- logging.LogErrorf("write av file [%s] failed: %s", path, writeErr)+ if writeErr := os.WriteFile(oldPath, newData, 0644); nil != writeErr {+ logging.LogErrorf("write av file [%s] failed: %s", oldPath, writeErr)return nil}}- return nil- })- // 重命名数据库文件- for oldPath, newPath := range renameAvPaths {if err = os.Rename(oldPath, newPath); nil != err {logging.LogErrorf("rename av file from [%s] to [%s] failed: %s", oldPath, newPath, err)return