Question
What would be the recommended approach to verify that autogenerating a revision would return no operations?
The goal is to have that check run as part of a test suite or on CI so any changes to sqla models that don't have an associated migration are caught immediately.
thanks!
for CI purposes people usually use some variant of the recipe at https://alembic.sqlalchemy.org/en/latest/api/autogenerate.html#getting-diffs , where you run the diff from your current metadata model against the database. if the diff is empty, then nothing was autogenerated.
Exactly what I was looking for. Thank you
Most helpful comment
for CI purposes people usually use some variant of the recipe at https://alembic.sqlalchemy.org/en/latest/api/autogenerate.html#getting-diffs , where you run the diff from your current metadata model against the database. if the diff is empty, then nothing was autogenerated.