Merge "Remove code in migration 064 to drop an fkey that does not exist. Fixes LP bug #907878."
This commit is contained in:
@@ -32,7 +32,6 @@ def _get_table(name):
|
||||
|
||||
def upgrade(migrate_engine):
|
||||
meta.bind = migrate_engine
|
||||
dialect = migrate_engine.url.get_dialect().name
|
||||
instance_actions = _get_table('instance_actions')
|
||||
instances = _get_table('instances')
|
||||
uuid_column = Column('instance_uuid', String(36),
|
||||
@@ -50,17 +49,6 @@ def upgrade(migrate_engine):
|
||||
uuid_column.drop()
|
||||
raise
|
||||
|
||||
if not dialect.startswith('sqlite'):
|
||||
try:
|
||||
fkey_name = list(instance_actions.c.instance_id.foreign_keys)[0].\
|
||||
constraint.name
|
||||
ForeignKeyConstraint(columns=[instance_actions.c.instance_id],
|
||||
refcolumns=[instances.c.id],
|
||||
name=fkey_name).drop()
|
||||
except Exception:
|
||||
logging.error(_("foreign key constraint couldn't be removed"))
|
||||
raise
|
||||
|
||||
instance_actions.c.instance_id.drop()
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user