mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 17:16:01 +00:00
revert row changes command
This commit is contained in:
@@ -179,3 +179,13 @@ export function changeSetToSql(changeSet: ChangeSet): Command[] {
|
||||
...changeSet.deletes.map(deleteToSql),
|
||||
];
|
||||
}
|
||||
|
||||
export function revertChangeSetRowChanges(changeSet: ChangeSet, definition: ChangeSetRowDefinition): ChangeSet {
|
||||
const [field, item] = findExistingChangeSetItem(changeSet, definition);
|
||||
if (item)
|
||||
return {
|
||||
...changeSet,
|
||||
[field]: changeSet[field].filter(x => x != item),
|
||||
};
|
||||
return changeSet;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user