Monday 29 March 2010 9:34:38 am
Hello, I created a different delete function, which purges an object if the main node is selected to be deleted (the subtree is deleted too), otherwise just the tree node is removed. However, before I was able to fully implement this, I notice that there have been orphaned records in ezcontentobject and ezcontentobject_tree. I guess I have one simple question. Can an Object exist without a corresponding record in ezcontentobject_tree? From what I find, I'd say no, because how would you get to this object? But I'd like some confirmation too. Please. Also, here are the two queries I am using to find orphaned records. Type 1: No corresponding tree node SELECT DISTINCT co.id FROM ezcontentobject co LEFT JOIN ezcontentobject_tree cot ON co.id = cot.contentobject_id WHERE node_id IS NULL Type 2: No parent node SELECT DISTINCT contentobject_id AS id FROM ezcontentobject_tree WHERE parent_node_id NOT IN (SELECT DISTINCT node_id FROM ezcontentobject_tree) Do these queries look right? Thanks
|