"""
This is used to upgrade a old database to the new model
"""

__author__ = 'jmagady'

from migrate.versioning import api
from config import SQLALCHEMY_DATABASE_URI
from config import SQLALCHEMY_MIGRATE_REPO


api.upgrade(SQLALCHEMY_DATABASE_URI, SQLALCHEMY_MIGRATE_REPO)
"""
runs the migration script in the repo
"""
v = api.db_version(SQLALCHEMY_DATABASE_URI, SQLALCHEMY_MIGRATE_REPO)  # gets the new db version number
print('Current database version: ' + str(v))