2017-04-23 22:06:55 -05:00
|
|
|
##########################################################################
|
|
|
|
#
|
|
|
|
# pgAdmin 4 - PostgreSQL Tools
|
|
|
|
#
|
2019-01-02 04:24:12 -06:00
|
|
|
# Copyright (C) 2013 - 2019, The pgAdmin Development Team
|
2017-04-23 22:06:55 -05:00
|
|
|
# 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, fs_encoding
|
|
|
|
with app.app_context():
|
|
|
|
flask_migrate.Migrate(app, db)
|
|
|
|
migration_folder = os.path.join(
|
2018-02-19 05:12:35 -06:00
|
|
|
os.path.dirname(os.path.realpath(u(__file__, fs_encoding))),
|
|
|
|
os.pardir, os.pardir,
|
|
|
|
u'migrations'
|
|
|
|
)
|
2017-04-23 22:06:55 -05:00
|
|
|
flask_migrate.upgrade(migration_folder)
|