codekingpro/portable-devtools
114k
1##########################################################################2#3# pgAdmin 4 - PostgreSQL Tools4#5# Copyright (C) 2013 - 2024, The pgAdmin Development Team6# This software is released under the PostgreSQL Licence7#8##########################################################################9 10import os11import flask_migrate12from flask import g13 14 15def db_upgrade(app):16 from pgadmin.utils import u_encode, fs_encoding17 with app.app_context():18 migration_folder = os.path.join(19 os.path.dirname(os.path.realpath(u_encode(__file__, fs_encoding))),20 os.pardir, os.pardir,21 'migrations'22 )23 # Below line is a workaround to make Flask-Migrate>=4.0.6 work.24 g.x_arg = []25 flask_migrate.upgrade(migration_folder)26 