Skip to content

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

:art: Database table view supports inserting columns in the middle https://github.com/siyuan-note/siyuan/issues/9993

Daniel1448827704fc
diff --git a/kernel/model/attribute_view.go b/kernel/model/attribute_view.go
index ebf0852a4b..51a6d84fb1 100644
--- a/kernel/model/attribute_view.go
+++ b/kernel/model/attribute_view.go
@@ -1923,6 +1923,11 @@ func addAttributeViewColumn(operation *Operation) (err error) {
for _, view := range attrView.Views {
switch view.LayoutType {
case av.LayoutTypeTable:
+ if "" == operation.PreviousID {
+ view.Table.Columns = append([]*av.ViewTableColumn{{ID: key.ID}}, view.Table.Columns...)
+ break
+ }
+
added := false
for i, column := range view.Table.Columns {
if column.ID == operation.PreviousID {