Skip to content

Commit

Permalink
🎨 Improve database table view
Browse files Browse the repository at this point in the history
  • Loading branch information
88250 committed Dec 13, 2023
1 parent 6c462db commit 05bf460
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions kernel/model/attribute_view.go
Original file line number Diff line number Diff line change
Expand Up @@ -1670,6 +1670,7 @@ func replaceAttributeViewBlock(operation *Operation, tx *Transaction) (err error
}
}

replacedRowID := false
for _, v := range attrView.Views {
switch v.LayoutType {
case av.LayoutTypeTable:
Expand All @@ -1682,8 +1683,14 @@ func replaceAttributeViewBlock(operation *Operation, tx *Transaction) (err error
for i, rowID := range v.Table.RowIDs {
if rowID == operation.PreviousID {
v.Table.RowIDs[i] = operation.NextID
replacedRowID = true
break
}
}

if !replacedRowID {
v.Table.RowIDs = append(v.Table.RowIDs, operation.NextID)
}
}
}

Expand Down

0 comments on commit 05bf460

Please sign in to comment.