Skip to content

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

:art: Improve add database table view

Daniel43e0beaeae8d
diff --git a/kernel/model/attribute_view.go b/kernel/model/attribute_view.go
index 8292808ba2..1f46e93d59 100644
--- a/kernel/model/attribute_view.go
+++ b/kernel/model/attribute_view.go
@@ -785,6 +785,7 @@ func (tx *Transaction) doDuplicateAttrViewView(operation *Operation) (ret *TxErr
}
view.Table.PageSize = masterView.Table.PageSize
+ view.Table.RowIDs = masterView.Table.RowIDs
if err = av.SaveAttributeView(attrView); nil != err {
logging.LogErrorf("save attribute view [%s] failed: %s", avID, err)
@@ -817,6 +818,8 @@ func (tx *Transaction) doAddAttrViewView(operation *Operation) (ret *TxErr) {
view.Table.Columns = append(view.Table.Columns, &av.ViewTableColumn{ID: col.ID})
}
+ view.Table.RowIDs = firstView.Table.RowIDs
+
if err = av.SaveAttributeView(attrView); nil != err {
logging.LogErrorf("save attribute view [%s] failed: %s", avID, err)
return &TxErr{code: TxErrWriteAttributeView, msg: err.Error(), id: avID}