Still on Drupal 7? Security support for Drupal 7 ended on 5 January 2025. Please visit our Drupal 7 End of Life resources page to review all of your options.Dear friends. I am a Drupal "user/administrator" for few months. I developed a project which involves one main portal and some satellite portals. I decided that the administration should involve only the main portal in order to increase the maintainability.
Probably the biggest problem in doing that was to split the database, sharing some tables and duplicating others in the satellite portals. Things work but I had a lot of problems in deciding what tables could be shared and what should be duplicated. And I doubt about de future dependencies between tables and modules
A better documentation of the database structure could facilitate this kind of "different views of the database".
So I propose different possibilities in order to have this documentation:
- An UML diagram of the database. I think is difficult to maintain in a collaborative effort.
- A simple description of each table which could be made for each project involved in drupal. The items could be very simple: table name, project/modules, purpose of the table, table dependencies. This could be made as documentation tables in the drupal database or as a collaborative document. Probably including this as a metadescription of drupaldatabase in the drupal database is a good solution.
What dou you think? I do not know all the internal details of drupal but from an administrator point of view the dependencies beetween tables difficutl the task (for instance: If you want to have different image galleries in the satellite portals using taxonomies in the main portal you have to duplicate the gallery taxonomy in the main portal, manually modify the filed image_nav_vocabulary in table variable and IMPORTANT:duplicate the table vocabulary_node_types in order to avoid the diferentt taxonomies for an image. Obviously this is a complex structure but the other posibility which is to duplicate the taxonomies in all the portals implies to maintain a big amount of duplicate taxonomies).
Please, if you decide to document the tables I could provide a first approach of my (provisional) experience.
Thank you. jparets@ugr.es
Comments
Comment #1
puregin commentedThanks for your suggestions - better documentation of the database structure and a better organization for this documentation is indeed a good idea.
There are a number of tools which attempt to automatically generate structure diagrams of various kinds directly from the database, or the SQL definition files. I'll have a look at whether these might be an acceptable way to address this problem.
I agree that documenting contributed modules w.r.t. their extensions/use of the database is another issue we should look at.
It would be nice to have clear, easy to find and easy to use documention for common database tasks.
(e.g. sharing a database among multiple installations, dealing with complications from upgrading, ...)
Djun
Comment #2
fgmI've created a few UML diagrams for the concepts in Drupal (not necessarily matching the physical implementation), which you can reuse (they're under the very open CC BY license):
Project module:
http://blog.riff.org/index.php/2005/10/02/28-grokking-drupal-the-project...
Aggregator (not Aggregator2)
http://blog.riff.org/images/aggregator8.png
eCommerce (2 diagrams)
http://blog.riff.org/index.php/2005/08/07/9-grokking-drupal-e-commerce
Comment #3
beginner commentedAll the links in #2 are broken.
A Database structure documentation would in many cases be useful, just like api.drupal.org is VERY useful in documenting functions.
I don't see anything like this in the handbooks, yet.
But the database structure changes with every Drupal release... maybe the documentation would be better suited for api.drupal.org where changes between versions can be documented?
Comment #4
fgmHi, here are the updated links. Note that most of them have been incorporated in the Drupal handbooks, AFAIK:
Core:
http://blog.riff.org/2006_05_14_data_model_for_drupal_4_7_core
eCommerce (2+1 diagrams)
http://blog.riff.org/2005_08_07_grokking_drupal_e_commerce
http://blog.riff.org/2006_10_07_grokking_drupal_ecommerce_dependencies
Project module 4.6:
http://blog.riff.org/2005_10_02_grokking_drupal_the_project_module
Project module 4.7:
http://blog.riff.org/2006_07_28_grokking_drupal_the_project_module_in_dr...
Aggregator (not Aggregator2)
http://blog.riff.org/2005_09_17_grokking_drupal_the_feed_aggregator
Comment #5
beginner commentedI'm speaking about core only.
I didn't see the handbook page with it, but if you say that it's already been incorporated in the handbook, then this issue can be closed.
Or else, the issue can be kept open to follow up on the proper, per Drupal version documentation of the DB structure, within api.d.o, as I discussed above.
Comment #6
sinasalek commentedLooking for the same thing, it's amazing that drupal does not have any database structure documentation!!
Comment #7
add1sun commentedNote that in Drupal 6 this has changed. There is now a description in the new schema API and all of core has been documented. In the code these are seen in the .install files where the db schema is built on install. api.d.o doesn't parse it yet but the awesome Schema module does. So now you can just download 6, install Schema module and you have your own local DB docs.
Comment #8
sinasalek commentedsounds great :) thanks
Comment #9
beginner commentedComment #10
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.