Drupal 6 comes with a DB schema, which makes it possible now to programmatically draw a graph of the relationships among the tables.

Utilizing graphviz I played with the possibilities yesterday and here's a thumbnail of the result. Full-size versions can be found here.

The '.svg' and '.html' versions display a descriptive tooltip when you hover the mouse over fields.

Many tables are linked by "node.nid" or "user.uid" and in order to not clutter the display with too many "snakes" I colored "node.nid" links in green and "user.uid" ones in red. So wherever you see red or green lines don't bother following them with your eyes: you already know where they lead to.

Note that everything is done automatically. No tweaking is done by hand. The script uses drupal_get_schema() to learn about Drupal and a 'Makefile' is used to automate the generation of the various output files.

Comments

Fantastic! Been waiting for

Fantastic! Been waiting for this for years. (Well, months at least!)

Many thanks for making this.

gpk
----
www.alexoria.co.uk

...

Thanks.

I should mention here the efforts made by webchick, add1sun, bjaspan, and others, to make all this possible (and easy (and fun! :-)).

OK, thanks to the whole team

OK, thanks to the whole team then ;-)

In fact this is so good that it really ought to be featured as a News item - finally everyone can understand the Drupal DB structure. A page in the handbook would simply not be enough to mark this giant leap for Drupaldom! Also found the Schema module. Arguably should be in core since it could be a vital admin tool (particularly at upgrade time ...!) Looks fantastic :-D

gpk
----
www.alexoria.co.uk

Awesome, and thanks!

Thanks to all for this. I've been looking for something like this for a while. 22 Thumbs Up!

Oh no! The graphs aren't

Oh no! The graphs aren't there any more! I should have saved them locally!

Object not found!

The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.

gpk
----
www.alexoria.co.uk

...

The files are there. Try again.

I know the server sometimes go offline. I have no control over this, sorry.

Phew!

:-)

gpk
----
www.alexoria.co.uk

Incorporate into handbook?

I'm not sure where would be the best place for it. Depth level, probably http://api.drupal.org but I'm not sure you can add pages there. They seem to be automatically created from the code.

Maybe somewhere at http://drupal.org/contributors-guide

Totally agree. Definitely

Totally agree. Definitely needs to be there for Drupal 7 as well when it is released.

http://www.typo.co.il/~mooffie/tmp/schemagraph/output/schemagraph-2007-1...

usefull tool... subscribing

usefull tool... subscribing xD

"...en informática lo más inútil es siempre lo más divertido." xD -Sutin.

Howto or Manual

exist any step-by-step manual to do the same on my drupal-distribution?