Pendigard's picture
Upload folder using huggingface_hub (part 45)
15f5485 verified
Raw History Blame Contribute Delete
527 Bytes
"""Utility for upgrading the DB."""
# From: https://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-iv-database
from migrate.versioning import api
from config import SQLALCHEMY_DATABASE_URI
from config import SQLALCHEMY_MIGRATE_REPO
def upgrade_db():
"""Apply migrations."""
api.upgrade(SQLALCHEMY_DATABASE_URI, SQLALCHEMY_MIGRATE_REPO)
v = api.db_version(SQLALCHEMY_DATABASE_URI, SQLALCHEMY_MIGRATE_REPO)
print('Current database version: ' + str(v))
if __name__ == '__main__':
upgrade_db()