How I made the database

Here's a dump of the CREATE TABLE statements I used for the database.
(aka I ran SHOW CREATE TABLE on each table in use) Better use could be
made of foreign keys but I'll fix that later.