Downgrade for migration 2a1ee2fb59e0_add_mac_address_unique_constraint
fails as it gets wrong parameters name, source and local_cols,
although it expects name, source and type_.
Also as MySQL creates index for unique constraint it should be used
"with migration.remove_fks_from_table".
Closes-bug: #
1421631
Change-Id: Id86b2f339a6fb33fc4fd637ffbfc2cb6e75ef4fb
from alembic import op
+from neutron.db import migration
TABLE_NAME = 'ports'
CONSTRAINT_NAME = 'uniq_ports0network_id0mac_address'
def downgrade():
- op.drop_constraint(
- name=CONSTRAINT_NAME,
- source=TABLE_NAME,
- local_cols=['network_id', 'mac_address']
- )
+ with migration.remove_fks_from_table(TABLE_NAME):
+ op.drop_constraint(
+ CONSTRAINT_NAME,
+ TABLE_NAME,
+ type_='unique'
+ )