commit 2485118c24b2293747dfafb3be58a6bdc65f7d66
Author: Roman Podolyaka <email address hidden>
Date: Fri Oct 18 14:23:11 2013 +0300
Fix dropping of indexed columns in sqlite/sa08
Version 0.8 of SQLAlchemy added support of indexes
on expressions in addition to plain table columns,
which changed the way indexes are created.
This broke support of dropping columns of composite
indexes for SQLite: due to limitations of ALTER in
SQLite every time a column is dropped, we recreate
the whole table without the given column; if a
column is a part of a composite index, we change the
index definition to omit that column and then indexes
are recreated too.
SQLAlchemy versions starting from 0.8 no more pay
attention to 'columns' attribute of Index instances
when generating DDL for indexes, so when one of columns
of a composite index is dropped, we try to create a
new index on the column that doesn't exist anymore,
which of course fails.
Reviewed: https:/ /review. openstack. org/52634 github. com/stackforge/ sqlalchemy- migrate/ commit/ 2485118c24b2293 747dfafb3be58a6 bdc65f7d66
Committed: http://
Submitter: Jenkins
Branch: master
commit 2485118c24b2293 747dfafb3be58a6 bdc65f7d66
Author: Roman Podolyaka <email address hidden>
Date: Fri Oct 18 14:23:11 2013 +0300
Fix dropping of indexed columns in sqlite/sa08
Version 0.8 of SQLAlchemy added support of indexes
on expressions in addition to plain table columns,
which changed the way indexes are created.
This broke support of dropping columns of composite
indexes for SQLite: due to limitations of ALTER in
SQLite every time a column is dropped, we recreate
the whole table without the given column; if a
column is a part of a composite index, we change the
index definition to omit that column and then indexes
are recreated too.
SQLAlchemy versions starting from 0.8 no more pay
attention to 'columns' attribute of Index instances
when generating DDL for indexes, so when one of columns
of a composite index is dropped, we try to create a
new index on the column that doesn't exist anymore,
which of course fails.
Closes-Bug: #1241038
Change-Id: I777b8ce36e36f4 9bfb0889908811a 063cf1a527b