VPNaaS DB schema migration is not applied due to typo in FK name

Bug #1207811 reported by Roman Podoliaka
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
High
Roman Podoliaka

Bug Description

When applying migration 52ff27f7567a_support_for_vpnaas on MySQL I receive the following error:

sqlalchemy.exc.OperationalError: (OperationalError) (1005, "Can't create table 'ovs_neutron.ipsecpeercidrs' (errno: 150)") '\nCREATE TABLE ipsecpeercidrs (\n\tcidr VARCHAR(32) NOT NULL, \n\tipsec_site_connection_id VARCHAR(36) NOT NULL, \n\tPRIMARY KEY (cidr, ipsec_site_connection_id), \n\tFOREIGN KEY(ipsec_site_connection_id) REFERENCES ipsecsiteonnections (id) ON DELETE CASCADE\n)\n\n' ()

The error is caused by typo in FK name in 52ff27f7567a_support_for_vpnaas.py:
    sa.ForeignKeyConstraint(['ipsec_site_connection_id'],
                                ['ipsecsiteonnections.id'],
                                ondelete='CASCADE'),

while neutron/db/vpn/vpn_db.py contains the correct definition:
         sa.ForeignKey('ipsec_site_connections.id',
                      ondelete="CASCADE"),

So it's possible to generate DB schema correctly based on models definitions, but not to upgrade existing Neutron installation to the latest commit.

Tags: db
Changed in neutron:
assignee: nobody → Roman Podolyaka (rpodolyaka)
Changed in neutron:
importance: Undecided → High
status: New → Triaged
milestone: none → havana-3
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

Fix proposed to branch: master
Review: https://review.openstack.org/39983

Changed in neutron:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/39983
Committed: http://github.com/openstack/neutron/commit/8d4bb3ea29e71e11e76734d648b3a098c4ffeb53
Submitter: Jenkins
Branch: master

commit 8d4bb3ea29e71e11e76734d648b3a098c4ffeb53
Author: Roman Podolyaka <email address hidden>
Date: Fri Aug 2 18:12:42 2013 +0300

    Fix typo in FK name in VPNaaS DB schema migration

    Applying of migration 52ff27f7567a fails due to the typo
    in a table name referenced by a FK ('ipsecsiteonnections'
    instead of 'ipsec_site_connections').

    Fixes bug 1207811

    Change-Id: I9ee2933660c92d095db91003671478e691acecb1

Changed in neutron:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in neutron:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in neutron:
milestone: havana-3 → 2013.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.