Best Practice with node_revisions table?

Hi,

I'm writing some code that could one day make it into a module so I'd like to make sure I'm following best practices. Can anyone please help me out with the node_revisions table? Here's what (I think) I know thus far:

  • There will be one node record and 1 or potentially more node_revisions records related on nid.
  • There will be only be one node_revisions record for a given node when revision tracking is off.
  • node_revisions.vid is the primary key and hence will be unique.
  • node_revisions.timestamp contains an integer that corresponds to the the this revision was last updated.

Correct so far?

So these are my questions:

  • Can I assume that the node_revisions record with the latest timestamp is the most current?
  • Or should I assume that the node_revisions record with the largest vid is the most current?
  • If neither of the prior two how can I tell which node_revisions record is the most current for a node?
  • What is the node_revisions.log field used for? Mine are always blank?
  • Where do I set revision tracking in the UI? Do I do it on a per content-type basis? Globally? Other?
  • And finally, is there anything else I should know about working with the node_revisions using raw SQL?

Thanks in advance!

anyone?

MikeSchinkel - April 29, 2008 - 03:52

anyone?

bump

MikeSchinkel - May 1, 2008 - 02:25

bump

 
 

Drupal is a registered trademark of Dries Buytaert.