def deploy(): """Run deployment of database.""" from flask_migrate import init, migrate, stamp, upgrade # This model is required for flask_migrate to make the table from postmodel import Post # noqa: F401 from app import create_app, db app = create_app() app.app_context().push() db.create_all() # migrate database to latest revision init() stamp() migrate() upgrade() deploy()