mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-06 00:38:49 +01:00
🎨 Improve database field default filling https://github.com/siyuan-note/siyuan/issues/11966
This commit is contained in:
parent
ef80bbd230
commit
95a5b46800
9 changed files with 79 additions and 131 deletions
|
|
@ -829,7 +829,7 @@ func calcRelativeTimeRegion(count int, unit RelativeDateUnit, direction Relative
|
|||
return
|
||||
}
|
||||
|
||||
func (filter *ViewFilter) GetAffectValue(key *Key, defaultVal *Value) (ret *Value) {
|
||||
func (filter *ViewFilter) GetAffectValue(key *Key, defaultVal *Value, addingBlockID string) (ret *Value) {
|
||||
if nil != filter.Value {
|
||||
if KeyTypeRelation == filter.Value.Type || KeyTypeTemplate == filter.Value.Type || KeyTypeRollup == filter.Value.Type || KeyTypeUpdated == filter.Value.Type || KeyTypeCreated == filter.Value.Type {
|
||||
// 所有生成的数据都不设置默认值
|
||||
|
|
@ -854,6 +854,9 @@ func (filter *ViewFilter) GetAffectValue(key *Key, defaultVal *Value) (ret *Valu
|
|||
}
|
||||
|
||||
ret = filter.Value.Clone()
|
||||
ret.ID = ast.NewNodeID()
|
||||
ret.KeyID = key.ID
|
||||
ret.BlockID = addingBlockID
|
||||
ret.CreatedAt = util.CurrentTimeMillis()
|
||||
ret.UpdatedAt = ret.CreatedAt + 1000
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue