Skip to content
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

A command to check if migrations need to be generated #756

Closed
edigaryev opened this issue Nov 18, 2020 · 1 comment
Closed

A command to check if migrations need to be generated #756

edigaryev opened this issue Nov 18, 2020 · 1 comment
Labels
duplicate This issue or pull request already exists question usage and API questions

Comments

@edigaryev
Copy link
Contributor

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.

(copied and slightly edited from my StackOverflow question: https://stackoverflow.com/questions/61374525/how-do-i-check-if-alembic-migrations-need-to-be-generated)

@edigaryev edigaryev added the requires triage New issue that requires categorization label Nov 18, 2020
@zzzeek zzzeek added duplicate This issue or pull request already exists question usage and API questions and removed requires triage New issue that requires categorization labels Nov 18, 2020
@zzzeek
Copy link
Member

zzzeek commented Nov 18, 2020

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.

@zzzeek zzzeek closed this as completed Nov 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists question usage and API questions
Projects
None yet
Development

No branches or pull requests

2 participants