distribusi-verse/verse/deploydb.py

24 lines
586 B
Python

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