mirror of
https://github.com/logseq/logseq.git
synced 2026-05-23 12:14:06 +00:00
fix: changing property type or cardinality
doesn't update its timestamp. Changing a property's core behavior is worthy of a timestamp update
This commit is contained in:
@@ -93,8 +93,9 @@
|
||||
old-ref-type? (db-property-type/user-ref-property-types old-type)
|
||||
ref-type? (db-property-type/user-ref-property-types new-type)]
|
||||
(cond-> [(cond->
|
||||
{:db/ident ident
|
||||
:db/cardinality cardinality}
|
||||
(outliner-core/block-with-updated-at
|
||||
{:db/ident ident
|
||||
:db/cardinality cardinality})
|
||||
ref-type?
|
||||
(assoc :db/valueType :db.type/ref))]
|
||||
(and new-type old-ref-type? (not ref-type?))
|
||||
|
||||
@@ -16,8 +16,11 @@
|
||||
|
||||
(testing "Updates a property"
|
||||
(let [conn (db-test/create-conn-with-blocks {:properties {:num {:logseq.property/type :number}}})
|
||||
_ (outliner-property/upsert-property! conn :user.property/num {:type :default :cardinality :many} {})]
|
||||
(is (db-property/many? (d/entity @conn :user.property/num)))))
|
||||
old-updated-at (:block/updated-at (d/entity @conn :user.property/num))
|
||||
_ (outliner-property/upsert-property! conn :user.property/num {:cardinality :many} {})]
|
||||
(is (db-property/many? (d/entity @conn :user.property/num)))
|
||||
(is (> (:block/updated-at (d/entity @conn :user.property/num))
|
||||
old-updated-at))))
|
||||
|
||||
(testing "Multiple properties that generate the same initial :db/ident"
|
||||
(let [conn (db-test/create-conn-with-blocks [])]
|
||||
|
||||
Reference in New Issue
Block a user