1) Add attribute of type "object relations" to a class
2) Make a note of the Class Attribute ID
3) Set a value to some object of that class, save object
4) Do a search for the Content Class Attribute ID in these 3 DB tables:
5) Go to Setup -> Classes -> Your Class -> Edit
6) Delete the attribute
7) Repeat step 4
All reference to the Class Attribute ID should be removed from the database
ezcontentclass_attribute and ezcontentobject_attribute are cleared, but ezcontentobject_link retains a link to the attribute. This results in a link to the object still being shown in the admin interface under the relations tab for both objects.
Object Relation are also affected.