Files
pgadmin4/web/pgadmin/setup/db_upgrade.py
Cyril Jouve 5a253f9053 Change the following to replace Python 2 code with Python 3:
1) Replace the deprecated unit test method.
2) Wraps filter usage in a list call.
3) Converts the old metaclass syntax to new.
4) Use range instead of xrange method.
5) Change Unicode to str.
6) Several other transformations.
7) Fixed change password test cases.
8) Use simplejson instead of plain JSON.
2020-08-31 16:45:31 +05:30

26 lines
738 B
Python

##########################################################################
#
# pgAdmin 4 - PostgreSQL Tools
#
# Copyright (C) 2013 - 2020, The pgAdmin Development Team
# This software is released under the PostgreSQL Licence
#
##########################################################################
import os
import flask_migrate
from pgadmin import db
def db_upgrade(app):
from pgadmin.utils import u_encode, fs_encoding
with app.app_context():
flask_migrate.Migrate(app, db)
migration_folder = os.path.join(
os.path.dirname(os.path.realpath(u_encode(__file__, fs_encoding))),
os.pardir, os.pardir,
'migrations'
)
flask_migrate.upgrade(migration_folder)