views:

294

answers:

5

I need to document a legacy database schema for a new employee and as there's no design document I'd like to generate one from the existing schema. As the tables are MyISAM the foregin key relationships won't produce a nice graph. I'm interested in producing a document showing the important tables, their columns, types and remarks.

Are there any tools available to produce a nice document (PDF, DOC, HTML or RTF say) from the database schemas meta data? Or am I better writing a utility to export this myself (I was thinking dump it to XML and then transform it using XSLT)? The schema is running on MySQL 5.

A: 

If you're using PHPmyAdmin, you can flip over to the Designer tab to get a visual schema. You could print/screenshot that if you just want to show table relationships.

Nathan Long
The MyISAM tables don't show relationships very well due to foreign key issues from what I remember. I'm looking for something that documents the tables and columns more than the relationships (I've updated the question to reflect this).
BenM
Is there a reason why you can't convert the tables to InnoDB?
Nathan Long
A: 

Sybase Powerdesigner, is one of the best tool for reverse engineering a DB, producing nice diagrams and nice exports.

PulsarBlow
I couldn't see any examples of their reports on their website and there was no clear pricing so I'm a bit wary of this at the moment. Thanks for the suggestion though.
BenM
Importing and Exporting Model Graphicshttp://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.stf.powerdesigner.docs_12.0.0/title.htmPowerdesign 15 supports XMI for cross products exchanges.
PulsarBlow
+1  A: 

You can use Mysql Workbenck or his ancestor DBdesigner 4 (open source):

  1. Capture all the database diagram graphically with the "reverse engineering" tool.
  2. Adjust and comment anything you need.
  3. Use the HTML report plugin included in the plugins menu.

Done!

backslash17
Unfortunately the Workbench doesn't have the plugin available in the free version. The DBDesigner tool looks like it has it but was failing to import my database (looks like a memory access violation).I'll have to see if I can see any examples of the output of the workbench tool to see if it's worth me buying a licence. Especially given the type of documentation I'm looking to produce.
BenM
A: 

DeZign for Databases can do that for you. Auto-layout is done after the import of your database. You can eventually rearrange the objects in the diagram and then generate a html (or pdf) report from your database including a clickable diagram. DeZign for Databases

+1  A: 

After some research and looking at the options available I've decided to use schema spy which does pretty much want I wanted.

It produced the results in a reasonable format, but also provided an XML dump of the meta data which I was able to use to write an XSLT transformation to match what I wanted in the first place.

Tip came from answer to question 1869.

BenM