]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
DB migration 25->24 failed when dropping column
authorXing Yang <xing.yang@emc.com>
Sat, 20 Sep 2014 22:23:11 +0000 (18:23 -0400)
committerXing Yang <xing.yang@emc.com>
Sat, 20 Sep 2014 22:37:52 +0000 (18:37 -0400)
commit71e78407954d108879bd51664f97fb5aeb5729dc
tree9b0d164d1d41a75ccf41590c27fc079835535cff
parent6a7277dbfe85abc6e80a7a5a1ef4b15039a21adc
DB migration 25->24 failed when dropping column

"cinder-manage db sync 24" failed when dropping column cgsnapshot_id
from the snapshots table.

The reason that drop column failed was because of the foreign key
constraint. MySQL cannot drop column until the foreign key constraint
is removed. So the solution is to remove the foreign key first, and
then drop the column. This affects the cgsnapshot_id column in the
snapshots table and the consistencygroup_id column in the volumes table.

Change-Id: I89d5016be450ec91c7a7b1c42803add3f62c88df
Closes-Bug: #1368213
cinder/db/sqlalchemy/migrate_repo/versions/025_add_consistencygroup.py
cinder/tests/test_migrations.py