From ffd574afca82c3c42f63efdebe892aad2bb28e3f Mon Sep 17 00:00:00 2001 From: Guillaume Viger Date: Mon, 19 Aug 2024 13:30:39 -0400 Subject: [PATCH] migrate to v12: emit non-zero exit code on error This is a convenience for automated upgrades to be able to detect errored command from the outside. --- invenio_app_rdm/upgrade_scripts/migrate_11_0_to_12_0.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/invenio_app_rdm/upgrade_scripts/migrate_11_0_to_12_0.py b/invenio_app_rdm/upgrade_scripts/migrate_11_0_to_12_0.py index 9ea4db4c1..e2a475715 100644 --- a/invenio_app_rdm/upgrade_scripts/migrate_11_0_to_12_0.py +++ b/invenio_app_rdm/upgrade_scripts/migrate_11_0_to_12_0.py @@ -38,6 +38,7 @@ - drafts visible - records visible """ +import sys from click import secho from flask import current_app @@ -184,6 +185,8 @@ def update_record(record): ) secho(msg, fg="yellow", err=True) + sys.exit(1) + # if the script is executed on its own, perform the upgrade if __name__ == "__main__":