mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-18 15:40:12 +01:00
🎨 Add Relation column to database table view https://github.com/siyuan-note/siyuan/issues/9888
This commit is contained in:
parent
2953870db5
commit
356b6748c9
1 changed files with 14 additions and 12 deletions
|
|
@ -852,19 +852,21 @@ func updateAttributeViewColRelation(operation *Operation) (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if !destAdded {
|
if !destAdded {
|
||||||
destAv.KeyValues = append(destAv.KeyValues, &av.KeyValues{
|
if operation.IsTwoWay {
|
||||||
Key: &av.Key{
|
destAv.KeyValues = append(destAv.KeyValues, &av.KeyValues{
|
||||||
ID: operation.BackRelationKeyID,
|
Key: &av.Key{
|
||||||
Name: operation.Name,
|
ID: operation.BackRelationKeyID,
|
||||||
Type: av.KeyTypeRelation,
|
Name: operation.Name,
|
||||||
Relation: &av.Relation{AvID: operation.AvID, IsTwoWay: operation.IsTwoWay, BackKeyID: operation.KeyID},
|
Type: av.KeyTypeRelation,
|
||||||
},
|
Relation: &av.Relation{AvID: operation.AvID, IsTwoWay: operation.IsTwoWay, BackKeyID: operation.KeyID},
|
||||||
})
|
},
|
||||||
|
})
|
||||||
|
|
||||||
for _, v := range destAv.Views {
|
for _, v := range destAv.Views {
|
||||||
switch v.LayoutType {
|
switch v.LayoutType {
|
||||||
case av.LayoutTypeTable:
|
case av.LayoutTypeTable:
|
||||||
v.Table.Columns = append(v.Table.Columns, &av.ViewTableColumn{ID: operation.KeyID})
|
v.Table.Columns = append(v.Table.Columns, &av.ViewTableColumn{ID: operation.KeyID})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue