tim.mitch...@leapfrog3d.com wrote:
> Hi all, > > I would like to have a post-deployment check that verifies the sqlalchemy > metadata in the code matches what is in the database. > I was thinking that doing something like > > alembic revision --autogenerate --sql > changes.sql > > and then check changes.sql. However, alembic tells me that "Using --sql with > --autogenerate does not make any sense", and indeed, if you hack the code in > command.py to remove the check you are blessed with tracebacks that do not > make any sense (to me anyway ;-) ). > > Can anyone suggest a way I might do this? You’re actually doing something that they are starting to do in Openstack, so luckily I can confirm this is feasible. You want to use the autogenerate API directly. Call upon compare_metadata documented at http://alembic.readthedocs.org/en/latest/api.html#autogeneration. Ideally, if “diff == []”, then there’s no changes. -- You received this message because you are subscribed to the Google Groups "sqlalchemy-alembic" group. To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy-alembic+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.