Fix unnamed contraints removal for postgresql

Change-Id: Iddfcff965f67e637157e929614ca9ac48ffa7681
Closes-Bug: #1592824
This commit is contained in:
Ralf Haferkamp 2016-06-15 15:26:01 +02:00
parent f787f454db
commit 13fb0b7549

View File

@ -46,8 +46,10 @@ def upgrade(active_plugins=None, options=None):
remote_cols=['id'])
with migration.remove_fks_from_table(
'gpm_service_policy_ipaddress_mappings'):
pk_constraint = inspector.get_pk_constraint(
'gpm_service_policy_ipaddress_mappings')
op.drop_constraint(
None,
pk_constraint['name'],
table_name='gpm_service_policy_ipaddress_mappings',
type_='primary')
op.create_primary_key(