Skip to content
Snippets Groups Projects
Commit 582eba15 authored by David Douard's avatar David Douard
Browse files

cli/db: Make the db init process a bit more (config) error resilient

We used to run all the sql init scripts before trying to determine the
backend's version, only to gather this piece of information at time we
want to write it in the dbversion table.

However, the presence of the dbversion is actually used to determine
whether a db has been initialized or not.

So if the configuration for the backend prevent it from being
instantiated, which is done to retrieve the backend version, then this
last initialization step will fail preventing any future 'swh db' handling
operation from working properly.

In this change, we move the backend version identification logic before
attempting any actual db initialization process so this situation does
not occur.
parent ce0d4b72
No related branches found
No related tags found
1 merge request!400cli/db: Make the db init process a bit more (config) error resilient
Pipeline #11935 passed