Jump to Navigation

Drupal 7 Database Schema

A while ago, the data model of Drupal was discussed in the LinkedIn Drupal group. A number of good pointers to data models of D6 and D5, and one for CiviCRM came up.


However, it doesn't seem that a D7 data model is available online.

This is my first go on creating a Drupal 7 database schema. I used all modules enabled in the "Standard Installation". It was created using MySQL workbench. The schema certainly needs revisions. Feel free to leave a comment,and I'll incorporate the revision.

The usefulness of this data model in Drupal programming is debatable, especially since many regularly used contributed modules are missing. However, the creation of the model helped me to further understand the Drupal 7 structure, and made me more familiar with the dependencies, thus the creation was helpful and educational.

Download Attachment: 


I just downloaded it to look at for awhile. Thanks for taking the time to start documenting this. I will try to find time to add to this if I can.

Thanks, any additions are welcome! It took me a month to actually put this up, after I made it, and sure can need a refresher, by going through it again.

My coder is trying to convince me to move to .
net from PHP. I have always disliked the idea because of the costs.
But he's tryiong none the less. I've been using WordPress
on several websites for about a year and
am worried about switching to another platform.

I have heard great things about blogengine.net. Is there a way I can transfer all my wordpress content
into it? Any kind of help would be really appreciated!

Moving a blog from wordpress to .NET would be plain stupidity in 98% of all thinkable cases. Why replace a well established system used be millions of sites with an incredible amount of modules, themes and information with one that barely anyone knows and that might be gone in a year?

Yours is cleaner than the one I came up with. Thanks for doing this.

Hehe, the website took fairly a great deal of time

to load but it was worth it.
Jon Milak

Thanks. I love getting the database diagrams. Couldn't wait for a Drupal 7 one and this one is perfect. I put it up on my wall.

How did you get the relationship lines? I'm using MYSQL Workbench to reverse engineer my db and I get the Diagrams but no relationship lines. Could you help me out? Thanks.

Hi, I added the relationship lines manually, by looking at the tables, and using workbench's tools. It made me look at each table, and understand the relationships.

Good article. I will be facing some of these issues as well.

That's a cleaner code than mine.

thank you! :)

I have some D7 to D7 database black magick I need to do in the very near future - finding this is VERY timely! Thank a mint for sharing!


The utilization of databases is now so widespread that virtually every technology and product relies on databases and DBMSs for its development and commercialization, or even may have such software embedded in it. Also, organizations and companies, from small to large, depend heavily on databases for their operations. Thanks.

Hello thank you for this, can you upload the mwb file somewhere? So I can open it with mysql workbench? Thanks.

I added the file to the page. Enjoy!

Great work Ursula!

I neеded to thank уou for this fantаstic read!
! I definitеly enϳoyed eѵery little bit оf it.

I have got you book marκed tο cheсk out new thіngѕ you ρost…

my blοg pοѕt - επιπλα μοντερνα

Thanks a lot!

Thank you a lot!

Great resource! Thanks for sharing!

thanks for sharing :)

Thank you so much .you definatly saved alot of time for me.thank you again

I believe field_data_body.entity_id is a foreign key, that points to various tables, depending on value of field_data_body.entity_type. If field_data_body.entity_type='node', then field_data_body.entity_id joins on node.nid.

I'm new to Drupal, so I don't know whether it joins to any other tables. You could 'SELECT DISTINCT field_data_body.entity_type' from a populated instance and see.

I'm not sure how you got the crow's feet to point away from the user_role table but they should be pointing towards the user roles table in a many to many relationship.

My mistake at interpreting the ERD. I am still learning my way around sql workbench. There is no error here.

Hi Matthew, Thanks for letting me know! I don't have to fix it now! Ursula

Add new comment

(If you're a human, don't change the following field)
Your first name.

Filtered HTML

  • Lines and paragraphs break automatically.
  • To post pieces of code, surround them with <code>...</code> tags. For PHP code, you can use <?php ... ?>, which will also colour it based on syntax.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd><h3><h4><img><pre><br><p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
By submitting this form, you accept the Mollom privacy policy.