Corrected order of table creation in database creation script