And now a version with all the foreign keys correctly set!
Corrected some field names on tables and foreign keys.