Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

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

longbingljwd9530f7bb75c
diff --git a/api/commands.py b/api/commands.py
index c4f2c9edbbe..93855bc3b87 100644
--- a/api/commands.py
+++ b/api/commands.py
@@ -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: