[openstack-dev] [all] Use of new batch_alter_table method of Alembic

Andrew Pashkin apashkin at mirantis.com
Fri Jan 23 13:56:14 UTC 2015


Hi all!

Recently In Murano project, we encountered a problem with drop column 
operation in Alembic migration using SQLite. And now we think, what is 
the best way to resolve this problem.

Alembic developers implemented a special tool as workaround for such cases:
https://bitbucket.org/zzzeek/alembic/issue/21/column-renames-not-supported-on-sqlite
http://alembic.readthedocs.org/en/latest/batch.html

Note, that they say, that this feature is in "Beta" mode currently.

So there are two options:
1) Use Alembic beta feature - batch_alter_table. This implies rewriting 
of all migrations with drop column and other operations.
2) Just recommend users to not use SQLite in cases where unsupported 
ALTER TABLE operations needed.

What do you think?

-- 
With kind regards, Andrew Pashkin.
cell phone - +7 (985) 898 57 59
Skype - waves_in_fluids
e-mail - apashkin at mirantis.com




More information about the OpenStack-dev mailing list