Working on this issue I encountered another problem. Most indices in the project has no names and because of that, developer must reverse-engineer them in every migration. Read about that also here .
SQLAlchemy and Alembic provide feature for generation constraint names by pattern, specifically to resolve that kind of issues . I decided to introduce usage of this feature in Murano. I've implemented solution that preserves backward-compatibility for migration and allows to rename all constraints according to patterns safely . With it user, that have already deployed Murano will be able to upgrade to new version of Murano without issues. There are downsides in this solution: - It assumes that all versions of Postgres and MySQL uses the same patterns for constraints names generation. - It is hard to implement a test for this solution and it will be slow. Because there is need to reproduce such situation when user has old versions of migrations applied, and then tries to upgrade. Another possible solution is to drop all current migrations and introduce new one with correct names. This brings us to new problem - migrations and models are out of sync right now in multiple places - there are different field types in migrations and models, migrations introduces indices that is absent in models, etc. And this solution has great downside - it is not backward-compatible, so all old users will lost their data. We (Murano team) should decide, what solution we want to use.  http://alembic.readthedocs.org/en/latest/naming.html#tutorial-constraint-names  https://review.openstack.org/150818 -- With kind regards, Andrew Pashkin. cell phone - +7 (985) 898 57 59 Skype - waves_in_fluids e-mail - apash...@mirantis.com __________________________________________________________________________ OpenStack Development Mailing List (not for usage questions) Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev