Make `swh db init` command work properly with the --dbname option
This allows to run the command `swh db init --dname DBURI` without giving a configuration file while still populating the dbversion table in the database. Note that this may not work for all swh packages, when the postgresql backend for the given swh package needs more configuration entries than just the psql connection string. This more or less drops support for "old style" db sql init scripts: - the `swh db init` will still work for an 'old style' package (in which the sql init scripts do create dbversion table and initialize it) but will display an error message, - the --initial-version option has been dropped, since this made sense only for old style packages, - the test data 'cli_new' has been renamed as 'cli' (in place of the previous "old style" one)
parent
f05624a3
No related branches found
No related tags found
Showing
- swh/core/cli/db.py 52 additions, 54 deletionsswh/core/cli/db.py
- swh/core/db/tests/conftest.py 2 additions, 2 deletionsswh/core/db/tests/conftest.py
- swh/core/db/tests/data/cli/sql/30-schema.sql 0 additions, 7 deletionsswh/core/db/tests/data/cli/sql/30-schema.sql
- swh/core/db/tests/data/cli/sql/50-data.sql 0 additions, 3 deletionsswh/core/db/tests/data/cli/sql/50-data.sql
- swh/core/db/tests/data/cli/sql/upgrades/001.sql 0 additions, 0 deletionsswh/core/db/tests/data/cli/sql/upgrades/001.sql
- swh/core/db/tests/data/cli/sql/upgrades/002.sql 0 additions, 0 deletionsswh/core/db/tests/data/cli/sql/upgrades/002.sql
- swh/core/db/tests/data/cli/sql/upgrades/003.sql 0 additions, 0 deletionsswh/core/db/tests/data/cli/sql/upgrades/003.sql
- swh/core/db/tests/data/cli/sql/upgrades/004.sql 0 additions, 0 deletionsswh/core/db/tests/data/cli/sql/upgrades/004.sql
- swh/core/db/tests/data/cli/sql/upgrades/005-bis.sql 0 additions, 0 deletionsswh/core/db/tests/data/cli/sql/upgrades/005-bis.sql
- swh/core/db/tests/data/cli/sql/upgrades/005.sql 0 additions, 0 deletionsswh/core/db/tests/data/cli/sql/upgrades/005.sql
- swh/core/db/tests/data/cli/sql/upgrades/006.sql 0 additions, 0 deletionsswh/core/db/tests/data/cli/sql/upgrades/006.sql
- swh/core/db/tests/data/cli_new/sql/0-superuser-init.sql 0 additions, 1 deletionswh/core/db/tests/data/cli_new/sql/0-superuser-init.sql
- swh/core/db/tests/data/cli_new/sql/15-flavor.sql 0 additions, 22 deletionsswh/core/db/tests/data/cli_new/sql/15-flavor.sql
- swh/core/db/tests/data/cli_new/sql/30-schema.sql 0 additions, 6 deletionsswh/core/db/tests/data/cli_new/sql/30-schema.sql
- swh/core/db/tests/data/cli_new/sql/40-funcs.sql 0 additions, 6 deletionsswh/core/db/tests/data/cli_new/sql/40-funcs.sql
- swh/core/db/tests/data/cli_new/sql/50-data.sql 0 additions, 2 deletionsswh/core/db/tests/data/cli_new/sql/50-data.sql
- swh/core/db/tests/test_cli.py 46 additions, 3 deletionsswh/core/db/tests/test_cli.py
- swh/core/db/tests/test_db_utils.py 23 additions, 31 deletionsswh/core/db/tests/test_db_utils.py
Loading
-
mentioned in commit anlambert/swh-vault@bcc61eba
-
mentioned in commit anlambert/swh-vault@e79675c2
-
mentioned in merge request swh-vault!185 (merged)
-
mentioned in commit swh-vault@1614bb65
Please register or sign in to comment