This is just code that you can run, so you can create an admin endpoint from which you can upgrade:
@app.route('/admin/dbupgrade') def dbupgrade(): from flask_migrate import upgrade, Migrate migrate = Migrate(app, db) upgrade(directory=migrate.directory) return 'migrated'
(Dropwizard, for example, is great for admin stuff like this through tasks )
source share