You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to improve CI pipeline to prevent situations where SQLAlchemy models are added or changed, but no Alembic migration is written or generated by the commit author from hitting the production branch.
alembic --help doesn't seem to provide any helpful commands for this case, yet it already has all the metadata required (target_metadata variable) and the database credentials in env.py to make this happen.
It would be nice to have this functionality as a separate Alembic command, e.g. alembic check.
the https://pypi.org/project/alembic-autogen-check/ tool does this. there's discussion over this tool as well as how to do this internally over at #724. As the maintainer of autogen-check does not appear to be responsive we can look to integrate the recipe given in #724.
I'm trying to improve CI pipeline to prevent situations where SQLAlchemy models are added or changed, but no Alembic migration is written or generated by the commit author from hitting the production branch.
alembic --help
doesn't seem to provide any helpful commands for this case, yet it already has all the metadata required (target_metadata variable) and the database credentials inenv.py
to make this happen.It would be nice to have this functionality as a separate Alembic command, e.g.
alembic check
.(copied and slightly edited from my StackOverflow question: https://stackoverflow.com/questions/61374525/how-do-i-check-if-alembic-migrations-need-to-be-generated)
The text was updated successfully, but these errors were encountered: