Skip to content

Commit

Permalink
CLI: ensure verdi database version works even if schema outdated (#…
Browse files Browse the repository at this point in the history
…4641)

The command was failing if the database schema was out of sync because
the backend was loaded, through `get_manager`, with the default schema
check on. Since the database does not actually have to be used, other
than to retrieve the current schema version and generation, we can load
the backend without the check.
  • Loading branch information
sphuber authored Dec 20, 2020
1 parent 6c60afb commit 32c3228
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion aiida/cmdline/commands/cmd_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ def database_version():
"""
from aiida.manage.manager import get_manager

backend_manager = get_manager().get_backend_manager()
manager = get_manager()
manager._load_backend(schema_check=False) # pylint: disable=protected-access
backend_manager = manager.get_backend_manager()

echo.echo('Generation: ', bold=True, nl=False)
echo.echo(backend_manager.get_schema_generation_database())
Expand Down

0 comments on commit 32c3228

Please sign in to comment.