Share » Forums » Setup & design » database inconsistency

database inconsistency

database inconsistency

Tuesday 10 June 2008 5:42:07 am - 2 replies

Modified on Tuesday 10 June 2008 5:44:34 am by Mads Ovesen

Author Message

Kristof Coomans

Tuesday 10 June 2008 6:22:43 am

Hi Mads

From the selects you did it is not really clear if there is any corruption or not. A content class can have multiple versions (final, draft) of which the attributes are all stored in the ezcontentclass_attribute table. To find any objects that are missing certain attributes, execute something like the following SQL:

SELECT o.id, v.version, a.identifier FROM ezcontentobject_version v, ezcontentobject o, ezcontentclass_attribute a
WHERE
  v.contentobject_id=o.id
  AND a.contentclass_id=o.contentclass_id
  AND a.version=0
  AND a.id NOT IN (SELECT contentclassattribute_id FROM ezcontentobject_attribute WHERE contentobject_id=o.id AND version=v.version)
ORDER BY o.id, v.version, a.placement;

Normally, when using a database with transactions enabled, it should not happen that your content object attributes get inconsistent with the content class definition because all changes are done in 1 transaction. Without transaction support though, inconsistencies might occur. Also see http://issues.ez.no/10203

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Mads Ovesen

Tuesday 17 June 2008 7:15:37 am

Hi Kristof,

You are probably right, that I can not put is as easy as I did in the original post. But, never the less, there is a problem:

I'm missing 3 attributes when I try to edit an existing object compared to the class definition. When I create new objects of this class, there seems to be no problem. Any idea of how this has happend and what I can do about it??

/m

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu