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

Do not do call swh_db_upgrade if not needed in `swh db upgrade`

parent ae654de0
No related branches found
No related tags found
1 merge request!255Do not do call swh_db_upgrade if not needed in `swh db upgrade`
......@@ -389,13 +389,19 @@ def db_upgrade(ctx, module, to_version):
f"{ds_version} of the datastore backend {db_module}"
)
new_db_version = swh_db_upgrade(dbname, module, to_version)
click.secho(f"Migration to version {new_db_version} done", fg="green")
if new_db_version < ds_version:
if to_version == db_version:
click.secho(
f"Warning: migration was not complete: the current version is {ds_version}",
fg="yellow",
f"No migration needed: the current version is {db_version}", fg="yellow",
)
else:
new_db_version = swh_db_upgrade(dbname, module, to_version)
click.secho(f"Migration to version {new_db_version} done", fg="green")
if new_db_version < ds_version:
click.secho(
"Warning: migration was not complete: "
f"the current version is {ds_version}",
fg="yellow",
)
def get_dburl_from_config(cfg):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment