Skip to content

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

:art: Add Relation column to database table view https://github.com/siyuan-note/siyuan/issues/9888

Danieleca04497d7b9
diff --git a/kernel/model/attribute_view.go b/kernel/model/attribute_view.go
index 933ba5d49a..d96fb75c7a 100644
--- a/kernel/model/attribute_view.go
+++ b/kernel/model/attribute_view.go
@@ -2173,8 +2173,10 @@ func UpdateAttributeViewCell(tx *Transaction, avID, keyID, rowID, cellID string,
oldBoundBlockID := val.BlockID
var oldRelationBlockIDs []string
if av.KeyTypeRelation == val.Type {
- for _, bID := range val.Relation.BlockIDs {
- oldRelationBlockIDs = append(oldRelationBlockIDs, bID)
+ if nil != val.Relation {
+ for _, bID := range val.Relation.BlockIDs {
+ oldRelationBlockIDs = append(oldRelationBlockIDs, bID)
+ }
}
}
data, err := gulu.JSON.MarshalJSON(valueData)