added final database tables and foreign keys