2022-01-05 13:42:24 +01:00
|
|
|
def deploy():
|
|
|
|
"""Run deployment of database."""
|
|
|
|
from app import create_app, db
|
|
|
|
from flask_migrate import upgrade, migrate, init, stamp
|
2022-01-07 16:55:40 +01:00
|
|
|
|
|
|
|
# This model is required for flask_migrate to make the table
|
|
|
|
from usermodel import User # noqa: F401
|
2022-01-05 13:42:24 +01:00
|
|
|
|
|
|
|
app = create_app()
|
|
|
|
app.app_context().push()
|
|
|
|
db.create_all()
|
|
|
|
|
|
|
|
# migrate database to latest revision
|
|
|
|
init()
|
|
|
|
stamp()
|
|
|
|
migrate()
|
|
|
|
upgrade()
|
|
|
|
|
|
|
|
|
|
|
|
deploy()
|