-
- Downloads
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.
Showing
- swh/core/cli/db.py 47 additions, 2 deletionsswh/core/cli/db.py
- swh/core/db/db_utils.py 35 additions, 1 deletionswh/core/db/db_utils.py
- swh/core/db/tests/data/cli/50-data.sql 1 addition, 1 deletionswh/core/db/tests/data/cli/50-data.sql
- swh/core/db/tests/data/cli_new/0-superuser-init.sql 1 addition, 0 deletionsswh/core/db/tests/data/cli_new/0-superuser-init.sql
- swh/core/db/tests/data/cli_new/30-schema.sql 6 additions, 0 deletionsswh/core/db/tests/data/cli_new/30-schema.sql
- swh/core/db/tests/data/cli_new/40-funcs.sql 6 additions, 0 deletionsswh/core/db/tests/data/cli_new/40-funcs.sql
- swh/core/db/tests/data/cli_new/50-data.sql 2 additions, 0 deletionsswh/core/db/tests/data/cli_new/50-data.sql
- swh/core/db/tests/test_cli.py 46 additions, 5 deletionsswh/core/db/tests/test_cli.py
- swh/core/db/tests/test_db_utils.py 21 additions, 26 deletionsswh/core/db/tests/test_db_utils.py
Loading
Please register or sign in to comment