-
-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Return exit code from alembic #8
Comments
Thanks for the report. It looks like in this function: Lines 120 to 129 in 109199f
If we replaced |
I just tested your suggestion and it works as expected. Do you want a pull request for this? |
A PR would be much appreciated but I think if we do this we should probably adjust all commands to throw a proper exit code. Would you mind testing them to see if it works without any changes since they use a different method? The Line 101 in 109199f
We might need to wrap that in a There's also the Line 86 in 109199f
I'm not sure if this carries over the exit code too. |
For the Regarding the |
These commands are basically wrappers for the seed subcommand and alembic itself. They have an exit code which we now forward to the user calling us. Fixes nickjj#8
Hmm for the |
Any updates on this? Ran into the same issue when trying to set up running migrations as part of an automated Azure DevOps pipeline. |
I had an error in a migration and I noticed that Flask-DB discards the exit code from alembic.
You can test this easily by putting, e.g.,
raise ValueError("This should fail")
into a migrationsupgrade
method. When runningalembic upgrade head
directly the process exits with 1. When runningflask db migrate upgrade head
the exception gets printed but the commands exit code is set to 0. This is an issue when running database migrations with a configuration management system, in my case Ansible, as the error will silently be ignored.The text was updated successfully, but these errors were encountered: