fixed generate_model and improved connector mysql