zzzeek/alembic — pull request #2 by ijl (2013-08-22 17:59:28+00:00)
Title: #107: Index and UniqueConstraint autogeneration

I've added index and unique constraint autogeneration in this pull request.

The test migrations show it in a straight forward way, I think. Note the addition of _model_five() and another test class testing a migration from m2 to m5, in order to do more index changes. In particular see the change from m2 to m5 of user.name from a non-unique index to indexed and unique. That detection I found the most complex.

I see this passing with SQLite, PostgreSQL, and MySQL.

This is expanded and refactored from the partial patch of limodou on the Bitbucket ticket: https://bitbucket.org/zzzeek/alembic/issue/107/we-really-really-need-at-least-rudimental

Criticism welcome.