distribusi-verse/verse/deploydb.py

22 lines
508 B
Python
Raw Normal View History

2022-01-05 13:42:24 +01:00
def deploy():
"""Run deployment of database."""
2024-04-21 20:44:08 +02:00
from flask_migrate import init, migrate, stamp, upgrade
2024-04-21 20:44:08 +02:00
from app import create_app, db
from models.distribusimodel import Distribusis # noqa: F401
# This model is required for flask_migrate to make the table
2024-04-21 20:44:08 +02:00
from models.usermodel import User # noqa: F401
2022-02-13 23:06:16 +01:00
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()