I have been looking for quite some time for a good entity relationship diagram (ERD) and still don't seem to have: a) Found a good one which is simple to understand; b) found a complete one.
I think that for overall development it would be useful to see how extension of the database through impacts on the shape of the relationships and see that Schema lists a lot of relationships, but still no diagram. I am willing to make the diagram, but would like to know what kind of file format people would prefer the diagram to be in? Ideally I would assume that something other people could edit and re-submit.
If anyone has any good ideas about what file format/program would be most advantageous for the community to use that would be great.
Comments
_
I think part of the problem is that the diagram would be different for every single site. Sure you could do one for each version of core, but since anyone who cares about ERDs will likely have custom code, schema, and/or contributed modules, how useful would a core only diagram be? imo what would be nice is a module that spits out an erd of the current site much like the noderelationships module does for nodereference fields.
+1
Just wanted to say I totally agree with you.
There are plenty of schema creation tools out there. Most of them, MySQL workbench for instance, can auto create a diagram, even from MyISAM tables, if the tables have the right naming conventions and you use a script such as http://wb.mysql.com/?p=271
If Drupal made a modification to it's recommended primary and "foreign" key naming strategies, these diagrams could be automatically generated by these freely available tools.
This would be helpful not only to new users and developers looking to understand the drupal core, but it became a standard within the developer community, could be used to help people working with often heavily modifed database schemas.
That said, I will also offer my anecdotal story : Though a long time PHP programmer I am new to Drupal and so far think the concept is great. However the first site I've been asked to look at has over 150 tables and lots of modules, many of them custom and some (ergg) hacked standard modules. This is a complex install and I need to understand all the relationships involved. With no ERD my choices are to trawl through the database for literally days, or hand edit a MYSQL dump so that I can use a schema generation tool. This means taking days to understand relationships an ERD could give me in minutes.
Not sure how I vote to get a change like this implemented, I was lucky enough to meet Dries recently and put the idea to him, not sure thats the best way to put through a feature request though :)
One of the difficulties I
One of the difficulties I have certainly had is the fact that there appear to be 3/4 column names that are the same (aid) and making a relationship between the two is pretty difficult. Obviously with MySql getting foreign keys can be slightly tricky. I might look into the Schema module to see whether I can push an ERD tool into that.
Since this node still turns up when searching
Here are two links for Drupal 7:
http://www.interworks.com/blogs/jkhalaj/2012/04/12/drupal-7-usage-foreig...
http://upsitesweb.com/blog/2011/06/drupal-7-database-schema
Note: There are (sadly?) no plans currently to implement fk relations in Drupal Core. http://drupal.org/node/911352