HomeSoftware Heritage

Make 'swh db init' fill the dbversion table

Description

Make 'swh db init' fill the dbversion table

for this feature to work properly, the backend datastore package must
provide the 'get_datastore' factory function in its root namespace and
the datastore instance must provide a 'get_current_version()' method.

This also means the canonical cli usage for the swh db init is now
using the config file (via --config-file or SWH_CONFIG_FILENAME)
instead of giving only the db cnx string (--db-name), so that the
backend datastore class can be instanciated using the get_datastore()
factory function.

However a '--initial-version' cli option has been added to 'swh db init'
to make it easier, especially for unit tests.

Details

Provenance
douarddaAuthored on Feb 1 2022, 2:51 PM
douarddaPushed on Feb 17 2022, 1:55 PM
Differential Revision
D7063: Make 'swh db init' fill the dbversion table
Parents
rDCOREf8a07dfa0bf6: Use a standard postgresql db fixture in test_cli
Branches
Unknown
Tags
Unknown
Tasks
T3894: Add a 'swh db upgrade' cli
Build Status
Buildable 26961
Build 42159: test-and-buildJenkins console · Jenkins