Updated schema

Had to alter the order of table creation.