Where does drupal 7 store the actual content in the database?
Asked Answered
B

2

5

I've opened a database of drupal 7 and looked up in the tables node, node_revisions and node types and couldn't find where drupal stores the actual body of the node (content).
Does anyone have a clue?

Blockbuster answered 29/12, 2009 at 8:34 Comment(1)
See also: stackoverflow.com/questions/15530862Smug
B
15

Oh, I've just found it. In D7 they implemented fields to allow custom fields in content. So, the node body is considered just a field and its value is now stored in the table field_revision_body (in D7) instead of node_revision (in D6).

If you cite any references for drupal database structure that would be helpful.

Thanks for reading.

Blockbuster answered 29/12, 2009 at 8:49 Comment(3)
thanks :) the new drupal Field API is really making the database layout very complex though.Blockbuster
Thanks for this question and answer. And where are the tags stored ?Delimitate
Node body content is stored in four tables: trid_field_data_body, trid_field_data_comment_body, trid_field_revision_body, and trid_field_revision_comment_body.Deluge
M
1

In Drupal 7 all the fields in the base table are known as properties, like the title, author_id, current_time_stamp etc. All the other fields like body image and many other which you create are stored in other tables. Actually, Drupal make a separate table for every field in the database and store the primary key of the entity bundle (article, basic page) in that field_table as a foreign key. Basically Drupal make two tables for every field 1: is for storing the data (field_data_[name_of_field]) and 2: is for revision (field_revision_[name_of_field]).

Maddox answered 30/11, 2017 at 11:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.