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

Daniel0d57661632d8
diff --git a/kernel/model/attribute_view.go b/kernel/model/attribute_view.go
index 1074c56968..d165e05348 100644
--- a/kernel/model/attribute_view.go
+++ b/kernel/model/attribute_view.go
@@ -1917,7 +1917,7 @@ func removeAttributeViewColumn(operation *Operation) (err error) {
switch view.LayoutType {
case av.LayoutTypeTable:
for i, column := range view.Table.Columns {
- if column.ID == removedKey.ID {
+ if column.ID == removedKey.Relation.BackKeyID {
view.Table.Columns = append(view.Table.Columns[:i], view.Table.Columns[i+1:]...)
break
}
@@ -1925,6 +1925,7 @@ func removeAttributeViewColumn(operation *Operation) (err error) {
}
}
+ av.SaveAttributeView(destAv)
util.BroadcastByType("protyle", "refreshAttributeView", 0, "", map[string]interface{}{"id": destAv.ID})
}
}