The technology blog of Neil Thompson

The last few companies that I have worked for we have setup an internal wiki that everyone uses to hold information about all aspects of the business including, of course, the technical team. We use MediaWiki for this mainly because it is easy to setup and is also familiar to users through Wikipedia.

One area that we try and document is the database structure. Having this on hand and searchable in the wiki allows new employees to quickly get to grips with it and makes us all more productive.

The issue is that creating the MediaWiki tables by hand is a real pain, particularly with database tables with a large number of columns. In order to make this a less painful process I have written a short database script that given the database and table names will output information about the table in MediaWiki format.

If you are finding that PHPMyAdmin is truncating the output when you run the script so that you aren’t seeing all the details you may need to increase the number of characters that are displayed or temporarily turn this off by using the toggle in browse mode.