# Path: app/config.py
# SQLALCHEMY_DATABASE_URI = 'mysql+mysqlconnector://ris_user:r1s_p4ssw0rd@45.56.81.81/risDB'
# 
# Path: app/config.py
# SQLALCHEMY_MIGRATE_REPO = os.path.join(basedir, 'db_repository')


from migrate.versioning import api
from app.config import SQLALCHEMY_DATABASE_URI
from app.config import SQLALCHEMY_MIGRATE_REPO
#!flask/bin/python
v = api.db_version(SQLALCHEMY_DATABASE_URI, SQLALCHEMY_MIGRATE_REPO)
api.downgrade(SQLALCHEMY_DATABASE_URI, SQLALCHEMY_MIGRATE_REPO, v - 1)
v = api.db_version(SQLALCHEMY_DATABASE_URI, SQLALCHEMY_MIGRATE_REPO)

# Path: app/config.py
# SQLALCHEMY_DATABASE_URI = 'mysql+mysqlconnector://ris_user:r1s_p4ssw0rd@45.56.81.81/risDB'
# 
# Path: app/config.py
# SQLALCHEMY_MIGRATE_REPO = os.path.join(basedir, 'db_repository')


# Path: db_downgrade.py
from migrate.versioning import api
from app.config import SQLALCHEMY_DATABASE_URI
from app.config import SQLALCHEMY_MIGRATE_REPO

#!flask/bin/python
v = api.db_version(SQLALCHEMY_DATABASE_URI, SQLALCHEMY_MIGRATE_REPO)
api.downgrade(SQLALCHEMY_DATABASE_URI, SQLALCHEMY_MIGRATE_REPO, v - 1)
v = api.db_version(SQLALCHEMY_DATABASE_URI, SQLALCHEMY_MIGRATE_REPO)

print('Current database version: ' + str(v))