Last updated July 25, 2008. Created by aj045 on June 24, 2006.
Edited by AjK, sime. Log in to edit this page.
Here is a list of the tables and their respective columns that store the central node data in a (core) Drupal database.
- node
-
Contains basic information about each and every node in the system. Body content information is NOT retained here. See node_revisions table. This table serves the purpose of being able to quickly access information about nodes.
4.6.x 4.7.x 5.x 6.x Description nid nid The numeric ID for a node. This should always be a unique identifier. vid vid The numeric ID for the version of this node. This maps directly to the node_revisions table. This should always be a unique identifier. type type type type The machine-readable form for the type for this node. For example, in Drupal a default type is "Page", but the machine readable form of that type is page (note how it is all lowercase, this is common practice). language The language used in the content of this node. title title title title The title for this node. You may be wondering why only a title column exists for nodes in the node table and not a body. This is partly because it makes it easier to do fast queries against the database. For example, in Drupal 5.x, if you go to Administer > Content Management > Content, you'll notice that the list of content (if there is any) only has the title, type, author, and so forth, but no body or teaser. A query against the database is merely a query from the node table. Simple, fast, and elegant. user id user id uid uid The ID of the user who created this node. Drupal does not change this at all after it is created. The change in possession occurs in node_revisions. status status status status Indicates the publicity status of this node. 1 is published. 0 is unpublished. If you wish to add additional functionality by changing this value to a non-zero and non-one value, consider creating a separate table which contains additional values for the publicity of nodes. created on created on created created A Unix timestamp of the moment this node was created. changed changed A Unix timestamp of the last time this node was modified. comment comment Indicates whether or not commenting is enabled for this specific node. 1 is enabled. 0 is disabled. promote promote Indicates whether or not this node has been promoted to the front page. This may mean nothing if your site does not display new content on the front page. is moderate is moderate moderate moderate is sticky is sticky sticky sticky Indicates whether this node is a sticky node (stays at the top of a listing of nodes) or not. tnid translate -
node_revisions
-
This table contains every revision (edit) of every node in the system. If you must do a manual query for a node, be sure you call the latest revision for the node in question. Note that by default Drupal does not retain information about deleted nodes. In other words, if you delete a node, the revisions go, too.
4.6.x 4.7.x 5.x 6.x Description nid nid nid The ID of the node to which the revision occured. vid vid vid The revision ID. This is always unique in the entire revisions table. Or in otherwords, this NOT a unique identifer for just the
revisions to one node.uid uid uid The ID of the user who committed this revision. title title title The title of the node for this revision. This may be different if on this revision, a user changed the title. body body body The body of the node for this revision. More often than not, this will be what changes with each revision. teaser teaser teaser The teaser of the node for this revision. When Drupal generates a new revision, this is updated automatically. log log log A log message associated with this revision. Logs should be kept for especially page-like content where the page itself
will be around long but the content may be update often throughout it's life time.timestamp timestamp timestamp The Unix timestamp for the moment when this revision was committed. format format format The filter format used in this revision. See the filter_format table for the formats available to your Drupal installation. - node_access
-
Contains information about the visibility and accessibility of the nodes in the system. Unless you understand the precise use of this table, letting Drupal do with it what it must for each node is the suggested approach.
4.6.x 4.7.x 5.x 6.x Description nid nid nid nid The ID of the node to which this access rule applies. gid gid gid gid realm realm realm realm The domain of this access rule for this node. Default is all. grant_view grant_view grant_view grant_view grant_update grant_update grant_update grant_update grant_delete grant_delete grant_delete grant_delete - node_counter
-
Contains statistical information about each node, if you've enabled the Statistics module.
4.6.x 4.7.x 5.x 6.x Description nid nid nid nid The ID of the node to which this entry refers to. totalcount totalcount totalcount totalcount The total number of views for this node. daycount daycount daycount daycount The total nubmer of views per day for this node. timestamp timestamp timestamp timestamp A Unix timestamp of the last time this entry was updated with new information. - node_comment_statistics
-
Contains statistical information about the comments for each node, if the Comments module is enabled.
4.6.x 4.7.x 5.x 6.x Description nid nid nid nid The ID of the node to which this entry refers. last_comment_timestamp last_comment_timestamp last_comment_timestamp last_comment_timestamp A Unix timestamp of the time of the last posted comment for this node last_comment_name last_comment_name last_comment_name last_comment_name The name of the user who submitted the last comment. last_comment_uid last_comment_uid last_comment_uid last_comment_uid The ID of the user who last comment_count comment_count comment_count comment_count The count of the number of comments on this node alone. - node_type
- TODO
Comments
The source differs from this documentation.
http://api.drupal.org/api/file/modules/node/node.install/6/source has comments for a few other uncommented fields above, and some differences in interpretation.
'uid' => array(
'description' => 'The {users}.uid that owns this node; initially, this is the user that created it.',
'comment' => array(
'description' => 'Whether comments are allowed on this node: 0 = no, 1 = read only, 2 = read/write.',
'promote' => array(
'description' => 'Boolean indicating whether the node should be displayed on the front page.',
'moderate' => array(
'description' => 'Previously, a boolean indicating whether the node was "in moderation"; mostly no longer used.',
'tnid' => array(
'description' => 'The translation set id for this node, which equals the node id of the source post in each set.',
'translate' => array(
'description' => 'A boolean indicating whether this translation page needs to be updated.',
--
Yet another Drupal user.
Posting from abitechnologies.co.uk
--
Yet another Drupal user.
MorganAlley web hosting and design.
Comment column documentation wrong for 6.x
0 - disabled
1 - read only
2 - read/write
Webmaster, Buddhism for Vampires, Meaningness, and Approaching Aro