2017-04-23 22:06:55 -05:00
|
|
|
##########################################################################
|
|
|
|
#
|
|
|
|
# pgAdmin 4 - PostgreSQL Tools
|
|
|
|
#
|
2024-01-01 02:43:48 -06:00
|
|
|
# Copyright (C) 2013 - 2024, 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
|
2024-03-11 06:47:25 -05:00
|
|
|
from flask import g
|
2017-04-23 22:06:55 -05:00
|
|
|
|
|
|
|
|
|
|
|
def db_upgrade(app):
|
2020-07-09 08:25:33 -05:00
|
|
|
from pgadmin.utils import u_encode, fs_encoding
|
2017-04-23 22:06:55 -05:00
|
|
|
with app.app_context():
|
|
|
|
migration_folder = os.path.join(
|
2020-07-09 08:25:33 -05:00
|
|
|
os.path.dirname(os.path.realpath(u_encode(__file__, fs_encoding))),
|
2018-02-19 05:12:35 -06:00
|
|
|
os.pardir, os.pardir,
|
2020-08-31 06:15:31 -05:00
|
|
|
'migrations'
|
2018-02-19 05:12:35 -06:00
|
|
|
)
|
2024-03-11 06:47:25 -05:00
|
|
|
# Below line is a workaround to make Flask-Migrate>=4.0.6 work.
|
|
|
|
g.x_arg = []
|
2017-04-23 22:06:55 -05:00
|
|
|
flask_migrate.upgrade(migration_folder)
|