You do not have working DB connection ($this->api->db) in line 77 in SchemaGenerator. Check your DB connection: $this->dbConnect() in Frontent and database configuration in config.php.
Also please note, that using SchemaGenerators is quite evil thing to do, but if you really want to use one, then better use up-to-date one: atk4-addons/dynamic_model/Controller_AutoCreator_MySQL