[sqlalchemy] (Semi-)automated way to adjust constraint names via Alembic?

2014-07-02 Thread Ken Lareau
So, in my ongoing quest to make my team's operations database far more sane than it currently is, I want to fix all the constraint naming in the database to match the naming convention setting I have added to my SQLAlchemy configuration for the database. I could of course go through each table

Re: [sqlalchemy] (Semi-)automated way to adjust constraint names via Alembic?

2014-07-02 Thread Mike Bayer
Well you can get at the names that were used in the DB (using Inspector, or reflection) as well as the names that are in your metadata ([constraint for constraint in table.constraints for table in metadata.tables.values()], but as far as matching them up I'm not sure, it depends on what patterns

Re: [sqlalchemy] (Semi-)automated way to adjust constraint names via Alembic?

2014-07-02 Thread Ken Lareau
On Wed, Jul 2, 2014 at 6:44 PM, Mike Bayer mike...@zzzcomputing.com wrote: Well you can get at the names that were used in the DB (using Inspector, or reflection) as well as the names that are in your metadata ([constraint for constraint in table.constraints for table in