Skip to content

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

:art: Support modifying the primary key value of the binding block https://github.com/siyuan-note/siyuan/issues/9892

Daniel8363a3d8113e
diff --git a/kernel/model/attribute_view.go b/kernel/model/attribute_view.go
index ee1d9cd979..63e8dc22c5 100644
--- a/kernel/model/attribute_view.go
+++ b/kernel/model/attribute_view.go
@@ -1690,6 +1690,11 @@ func replaceAttributeViewBlock(operation *Operation, tx *Transaction) (err error
for _, keyValues := range attrView.KeyValues {
for _, value := range keyValues.Values {
if value.BlockID == operation.PreviousID {
+ if value.BlockID != operation.NextID {
+ // 换绑
+ unbindBlockAv(tx, operation.AvID, value.BlockID)
+ }
+
value.BlockID = operation.NextID
if nil != value.Block {
value.Block.ID = operation.NextID