From 964c822c2b7322f956234726f0bbb15106da35e4 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Tue, 10 Oct 2023 22:02:46 +0800 Subject: [PATCH] :art: Improve database created and updated column values https://github.com/siyuan-note/siyuan/issues/9391 --- kernel/model/attribute_view.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/kernel/model/attribute_view.go b/kernel/model/attribute_view.go index 099c67ba79f..afe6667ced4 100644 --- a/kernel/model/attribute_view.go +++ b/kernel/model/attribute_view.go @@ -1296,8 +1296,16 @@ func UpdateAttributeViewCell(tx *Transaction, avID, keyID, rowID, cellID string, bindBlockAv(tx, avID, rowID) } - if nil != val.Block { - val.Block.Updated = time.Now().UnixMilli() + for _, kv := range attrView.KeyValues { + if av.KeyTypeBlock == kv.Key.Type { + for _, v := range kv.Values { + if rowID == v.Block.ID { + v.Block.Updated = time.Now().UnixMilli() + break + } + } + break + } } if err = av.SaveAttributeView(attrView); nil != err {