text: Title: How to call apis(upgrade, current) in python script
  Body: I have a database `db`. I want to judge if `flask_migrate` has created tables in `db`. If not, `upgrade db`. 
  There are commands, but no examples about calling `migrate, upgrade` in python script. 
  The test files in flask_migrate also run commands, such as:
  `(o, e, s) = run_cmd('python app.py db migrate')`
  