Re: Rename an existing constraint

2017-08-29 Thread jens . troeger
Thank you, Mike! I’ll take a closer look at your proposed code this week. I am curious though: not even MySQL has a rename feature , is that because of consistency? PostgreSQL adds ALTER TABLE …

Re: Rename an existing constraint

2017-08-29 Thread Mike Bayer
Unfortunately there's no RENAME CONSTRAINT directive, so dropping and recreating is how it has to go. Alembic and SQLAlchemy together do have the ability to return lists of constraints and produce CREATE instructions for them. Recently I did some of this related to foreign keys, and the same

Rename an existing constraint

2017-08-29 Thread jens . troeger
Hello, I started out migrating my db schema forward using Alembic, and without any constraint naming convention. That caused constraints to be named using MySQL’s default naming. Alas, now I added a naming convention (see doc here