fix: make `flask upgrade-db` fail on error (#32024)

This commit is contained in:
longbingljw 2026-02-06 13:01:31 +09:00 committed by GitHub
parent b24e6edada
commit d9530f7bb7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 1 deletions

View File

@ -739,8 +739,10 @@ def upgrade_db():
click.echo(click.style("Database migration successful!", fg="green"))
except Exception:
except Exception as e:
logger.exception("Failed to execute database migration")
click.echo(click.style(f"Database migration failed: {e}", fg="red"))
raise SystemExit(1)
finally:
lock.release()
else: