Fix autogenerate diffs error handling

This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-12-01 17:02:37 -03:00
commit 2a8c972d49

View file

@ -155,7 +155,8 @@ class DatabaseService(Service):
command.check(alembic_cfg)
except util.exc.AutogenerateDiffsDetected as exc:
logger.exception("AutogenerateDiffsDetected: {exc}")
raise RuntimeError("Something went wrong running migrations. Please, run `langflow migration --fix`")
if not fix:
raise RuntimeError("Something went wrong running migrations. Please, run `langflow migration --fix`")
if fix:
self.try_downgrade_upgrade_until_success(alembic_cfg)