Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Remove code in migration 064 to drop an fkey that does not exist.
Fixes LP bug #907878.

Change-Id: I2e33fe3a58a34c9606b24eafc319afa9fd9a5d86
  • Loading branch information
Dan Prince committed Dec 22, 2011
1 parent 640e632 commit 2fcbe7e
Showing 1 changed file with 0 additions and 12 deletions.
Expand Up @@ -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),
Expand All @@ -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()


Expand Down

0 comments on commit 2fcbe7e

Please sign in to comment.