mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-10 07:26:01 -06:00
based configuration file from one version to another, and also allows us to have a single path of creating the table instead of creating tables using SQLAlchemy or hand rolled SQL This allows us to run the migrations directly in the code, and it will avoid the error prone version numbering. Patched by: Sarah McAlear Revisions: Joao Pedro De Almeida Pereira, George Gelashvili. Reviewed by: Ashesh Vashi, Murtuza Zabuawala
26 lines
741 B
Python
26 lines
741 B
Python
##########################################################################
|
|
#
|
|
# pgAdmin 4 - PostgreSQL Tools
|
|
#
|
|
# Copyright (C) 2013 - 2017, 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, fs_encoding
|
|
with app.app_context():
|
|
flask_migrate.Migrate(app, db)
|
|
migration_folder = os.path.join(
|
|
os.path.dirname(os.path.realpath(u(__file__, fs_encoding))),
|
|
os.pardir, os.pardir,
|
|
u'migrations'
|
|
)
|
|
flask_migrate.upgrade(migration_folder)
|