show generic index error and added support to autoreplace the collection id if part of an index name

This commit is contained in:
Gani Georgiev
2024-11-02 22:34:05 +02:00
parent fadb4e3d67
commit 1025fb2406
29 changed files with 128 additions and 106 deletions
@@ -192,6 +192,14 @@
}
}
}
// update index names that contains the collection id
for (let i = 0; i < collection.indexes?.length; i++) {
collection.indexes[i] = collection.indexes[i].replace(
/create\s+(?:unique\s+)?\s*index\s*(?:if\s+not\s+exists\s+)?(\S*)\s+on/gim,
(v) => v.replace(originalId, replacedId),
);
}
}
schemas = JSON.stringify(newCollections, null, 4);