yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #53776
[Bug 1599840] Re: Remove foreign key during db upgrade not remove unique constraint for it
Reviewed: https://review.openstack.org/338986
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=7a206a942f97201968a043b6bf557912253b0032
Submitter: Jenkins
Branch: master
commit 7a206a942f97201968a043b6bf557912253b0032
Author: Sławek Kapłoński <slawomir.kaplonski@xxxxxxx>
Date: Thu Jul 7 13:05:36 2016 +0000
Add function to remove constraints from database
Function used in alembic database migration script to
remove foreign keys from table doesn't remove unique constraint
created for such fk in table.
Sometimes there is need to remove also such unique constraint during
database upgrade.
Removing unique constraint is little bit different in mysql and
postgresql databases because names of such constraints are different.
This patch introduces function to remove constraints from table
during migration.
It is also used in remove_fks_from_table() function to allow removal
unique constraints when fk is removed.
Change-Id: I7e7732560984b1c1e45230434ddc4be8cf5ab630
Closes-Bug: #1599840
** Changed in: neutron
Status: In Progress => Fix Released
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1599840
Title:
Remove foreign key during db upgrade not remove unique constraint for
it
Status in neutron:
Fix Released
Bug description:
If in alembic db upgrade script function alembic.migration.remove_fks_from_table() is used it will not remove unique constraint for such foreign key if it was created.
There should be possibility to remove such constraints from db.
Because droping such constraints is littlebit different for mysql and postgresql (different names of constraint) there should be introduced new function "remove_constraints" which would be also used during remove foreign keys.
To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1599840/+subscriptions
References