[#4160] fixed the Admin UI auto indexes update when renaming fields with a common prefix

This commit is contained in:
Gani Georgiev
2024-01-16 12:48:41 +02:00
parent 931f6bc0cb
commit 9419d1928a
33 changed files with 50 additions and 40 deletions
@@ -80,9 +80,14 @@
return;
}
// field with the old name exists so there is no need to rename index columns
if (!!collection?.schema?.find((f) => f.name == oldName && !f.toDelete)) {
return;
}
// update indexes on renamed fields
collection.indexes = collection.indexes.map((idx) =>
CommonHelper.replaceIndexColumn(idx, oldName, newName)
CommonHelper.replaceIndexColumn(idx, oldName, newName),
);
}
</script>