Forums / Install & configuration / Database Integrity Question

Database Integrity Question

Author Message

Russell Michell

Thursday 04 June 2009 6:54:51 pm

Hi all,

I'm not sure how long this issue has been around for in my install (4.0.1) but I've only just noticed that upon saving/previewing one of my content objects (Folder class, object ID 355), I get the message "Object partially saved" (or similar) and that a specific node no longer exists.

When I look in the admin section, in the "Relations" area for the object (355), it says Relations [1], Related Objects [1] but literally nothing beneath that ( See screenshot: http://www.theruss.com/images/screenshot.png ) and no message in error.log.

So how do you delete the reference to the deleted/missing node?

In anycase, I think I tracked down the culprit and wanted to ask everyone else about this before I delete the reference in what I think is the appropriate table:

The ID of the content object with the broken-link to the deleted object is 355, so:

mysql> SELECT * FROM ezcontentobject_link WHERE from_contentobject_id = 355\G;
*************************** 1. row ***************************
contentclassattribute_id: 0
from_contentobject_id: 355
from_contentobject_version: 3
id: 1599
op_code: 0
relation_type: 4
to_contentobject_id: 210
1 row in set (0.00 sec)

Am I right in thinking that 'to_contentobject_id' is a 'foreign key' to ezcontentobject.id? If so then:

mysql> SELECT * FROM ezcontentobject WHERE id = 210;
Empty set (0.00 sec)

Does this mean this is a dead-link in my content object and I can safely delete the entry from ezcontentobject_link? FWIW - I backed up the DB and ran the delete, and the 'Relations' headings went back to normal ("There are no related objects...") I guess I need to know what impact, if any this may have on database integrity.

FWIW Selecting the "Check database consistency", everything is A-OK

Thanks a lot for your time,
Russ

Russell Michell, Wellington, New Zealand.
We're building! http://www.theruss.com/blog/
I'm on Twitter: http://twitter.com/therussdotcom

Believe nothing, consider everything.