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

Function upgrade_db

web/pgadmin/__init__.py:387–405  ·  view source on GitHub ↗

Execute the migrations.

()

Source from the content-addressed store, hash-verified

385 raise RuntimeError('Migration failed')
386
387 def upgrade_db():
388 """
389 Execute the migrations.
390 """
391 try:
392 db_upgrade(app)
393 os.environ['CORRUPTED_DB_BACKUP_FILE'] = ''
394 except Exception:
395 app.logger.error('Database migration failed')
396 app.logger.error(traceback.format_exc())
397 backup_db_file()
398
399 # check all tables are present in the db.
400 is_db_error, invalid_tb_names = check_db_tables()
401 if is_db_error:
402 app.logger.error(
403 'Table(s) {0} are missing in the'
404 ' database'.format(invalid_tb_names))
405 backup_db_file()
406
407 def run_migration_for_sqlite():
408 # Tighten the process umask while we may be creating the SQLite

Callers 1

run_migration_for_sqliteFunction · 0.85

Calls 4

db_upgradeFunction · 0.90
check_db_tablesFunction · 0.90
backup_db_fileFunction · 0.85
errorMethod · 0.80

Tested by

no test coverage detected