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

Function run_migration_for_others

web/pgadmin/__init__.py:472–487  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

470 os.chmod(config.SQLITE_PATH, 0o600)
471
472 def run_migration_for_others():
473 # Run migration for the first time i.e. create database
474 # If version not available, user must have aborted. Tables are not
475 # created and so its an empty db
476 if get_version() == -1:
477 db_upgrade(app)
478 else:
479 schema_version = get_version()
480
481 # Run migration if current schema version is greater than
482 # the schema version stored in version table.
483 if CURRENT_SCHEMA_VERSION > schema_version:
484 db_upgrade(app)
485 # Update schema version to the latest
486 set_version(CURRENT_SCHEMA_VERSION)
487 db.session.commit()
488
489 from pgadmin.browser.server_groups.servers.utils import (
490 delete_adhoc_servers)

Callers 1

create_appFunction · 0.70

Calls 3

get_versionFunction · 0.90
db_upgradeFunction · 0.90
set_versionFunction · 0.90

Tested by

no test coverage detected