2

As I understand it, the current value for every field can be found in corresponding data table (e. g. field_data_body) and the history of its changes in corresponding revision table (field_revision_body) with the value of newest revision being the same as the value in data table.

Is that, however, really true or do I have to (to get the current value) look into the newest revision (which id can be obtained from 'entity type' table (e. g. node table)). If that's the case then does the data table hold the first value or what?

In other words, when dealing with content in Drupal 7 directly (accessing database and not using Drupal functions (load_entity, etc.)) is it safe to work only with 'data' tables and not caring about 'revision' ones?

//I'm almost sure the way I understand is right and everything seems to verify it, I'd still like to be totally sure.

2

You are totally correct, the newest value is in the field_data table, you can rely on that.

field_revision just has a copy of the same data so that it knows about the revision immediately. I think it's just more hassle free to keep field_revision completely up to date rather than being one step behind field_data.

| improve this answer | |
  • I'm not sure if this is totally accurate. I think it is better to say that it has the current value. If you are using moderation (eg, Workflow Moderation) the the highest vid may not be what is in the data table. – mpdonadio Feb 26 '14 at 2:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.