Skip to content

Add a check_dbversion() method to the Db class

This method compares the version stored in the database in the dbversion table with the currently declared version.

This current version is declared as a simple current_version attribute on the Db class. It must be updated jointly in 30-swh-schema.sql when modifying the db schema. Note that if this is forgotten, the added test test_dbversion should fail.

Related to #2525 (closed).

Also:

  • Code cleanup: fix import statements swh.storage.common content has been moved to swh.core.db.common a while ago.
  • Fix pytest_plugin's database janitor: do not truncate the dbversion table

Migrated from D3814 (view on Phabricator)

Merge request reports