Explorar o código

:art: Database table view cell value adds `createdAt` and `updatedAt` fields https://github.com/siyuan-note/siyuan/issues/10492

Daniel hai 1 ano
pai
achega
e487897b54
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  1. 4 1
      kernel/model/attribute_view.go

+ 4 - 1
kernel/model/attribute_view.go

@@ -2594,12 +2594,15 @@ func UpdateAttributeViewCell(tx *Transaction, avID, keyID, rowID, cellID string,
 		}
 	}
 
+	now := time.Now().UnixMilli()
 	if nil != blockVal {
-		blockVal.Block.Updated = time.Now().UnixMilli()
+		blockVal.Block.Updated = now
+		blockVal.UpdatedAt = now
 		if isUpdatingBlockKey {
 			blockVal.IsDetached = val.IsDetached
 		}
 	}
+	val.UpdatedAt = now
 
 	key, _ := attrView.GetKey(val.KeyID)
 	if nil != key && av.KeyTypeRelation == key.Type && nil != key.Relation {