Why renaming edge class could break vertices

When renaming the class of an edge without the unsafe keyword, it throws an exception saying “Cannot alter class ‘the_class’ because is an Edge class and could break vertices”…

My question is why it is an unsafe operation and why could it break vertices? Why renaming a vertex class is not unsafe?

Hi @johny65

The problem is in the naming conventions behind edge representation.

If you have a FriendOf edge class, on the vertices you’ll have out_FriendOf and in_FriendOf properties pointing to RID collections (the edge RIDs).
This convention is used to traverse the relationships without having to load/check the edge records in advance.

If you rename the class, OrientDB won’t rename all the attributes (it would be way too expensive on typical databases), so the traversal wouldn’t work as expected anymore

I hope it helps



Ok, thank you @luigidellaquila for your explanation.