MCPcopy Create free account
hub / github.com/pgadmin-org/pgadmin4 / run_migration_for_others

Function run_migration_for_others

web/setup.py:834–851  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

832 os.chmod(config.SQLITE_PATH, 0o600)
833
834 def run_migration_for_others():
835 with app.app_context():
836 version = Version.query.filter_by(name='ConfigDB').first()
837 if version == -1:
838 db_upgrade(app)
839 else:
840 schema_version = version.value
841
842 # Run migration if current schema version is greater than the
843 # schema version stored in version table
844 if CURRENT_SCHEMA_VERSION >= schema_version:
845 db_upgrade(app)
846
847 # Update schema version to the latest
848 if CURRENT_SCHEMA_VERSION > schema_version:
849 version = Version.query.filter_by(name='ConfigDB').first()
850 version.value = CURRENT_SCHEMA_VERSION
851 db.session.commit()
852
853 # Run the migration as per specified by the user.
854 if config.CONFIG_DATABASE_URI is not None and \

Callers 1

setup_dbFunction · 0.70

Calls 2

db_upgradeFunction · 0.90
firstMethod · 0.65

Tested by

no test coverage detected