12

I have a lot of custom functions; I just want to make sure I'm doing this right.
If I want the most recent version—the live version—of a node, I go to the field_data_field_xyz table, right?

My understanding is the field_revision_field_xyz keeps all older versions, correct?

12

That is correct: Working with Field SQL Storage.

Database tables:

  • {field_data_[field_name]} Standard data storage for a field.
  • {field_revision_[field_name]} Standard revision storage for a field.
  • 1
    It's not very recommended to query these tables directly but I'll do it on many projects. Have a look at EntityFieldQuery and this answer. – tostinni Sep 21 '11 at 0:04
  • Yeah there were a bunch of places where Views just wouldn't cut it. What's the biggest downfall to querying the tables directly though? – Mike Sep 21 '11 at 15:38
  • IN D6 it was that field could change from the tabtle content_type_* to its own table, so you'd better use the API to build your query. In D7 this doesn't happen anymore so that's better ;) – tostinni Sep 21 '11 at 20:05
  • This answer is not 100% clear. If I needed to write SQL to be able to export the most current data, can I simply ignore the field_revision_field_* tables, or do I need to incorporate them into my export somehow, and if so, how? – MikeSchinkel Apr 25 '16 at 9:47

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.