diff --git a/vmware_nsx/db/migration/alembic_migrations/versions/liberty/expand/279b70ac3ae8_nsxv3_add_l2gwconnection_table.py b/vmware_nsx/db/migration/alembic_migrations/versions/liberty/expand/279b70ac3ae8_nsxv3_add_l2gwconnection_table.py index 00bc6e6632..32074174a8 100644 --- a/vmware_nsx/db/migration/alembic_migrations/versions/liberty/expand/279b70ac3ae8_nsxv3_add_l2gwconnection_table.py +++ b/vmware_nsx/db/migration/alembic_migrations/versions/liberty/expand/279b70ac3ae8_nsxv3_add_l2gwconnection_table.py @@ -30,19 +30,13 @@ import sqlalchemy as sa def upgrade(): - try: - op.create_table( - 'nsx_l2gw_connection_mappings', - sa.Column('connection_id', sa.String(length=36), nullable=False), - sa.Column('port_id', sa.String(length=36), nullable=False), - sa.Column('bridge_endpoint_id', sa.String(length=36), - nullable=False), - sa.ForeignKeyConstraint(['connection_id'], - ['l2gatewayconnections.id'], - ondelete='CASCADE'), - sa.ForeignKeyConstraint(['port_id'], ['ports.id'], - ondelete='CASCADE'), - sa.PrimaryKeyConstraint('connection_id'), - ) - except Exception: - pass + op.create_table( + 'nsx_l2gw_connection_mappings', + sa.Column('connection_id', sa.String(length=36), nullable=False), + sa.Column('port_id', sa.String(length=36), nullable=False), + sa.Column('bridge_endpoint_id', sa.String(length=36), + nullable=False), + sa.ForeignKeyConstraint(['port_id'], ['ports.id'], + ondelete='CASCADE'), + sa.PrimaryKeyConstraint('connection_id'), + ) diff --git a/vmware_nsx/db/nsx_models.py b/vmware_nsx/db/nsx_models.py index c32f001794..2e28589411 100644 --- a/vmware_nsx/db/nsx_models.py +++ b/vmware_nsx/db/nsx_models.py @@ -306,8 +306,6 @@ class NsxL2GWConnectionMapping(model_base.BASEV2): """Define a mapping between L2 gateway connection and bridge endpoint.""" __tablename__ = 'nsx_l2gw_connection_mappings' connection_id = sa.Column(sa.String(36), - sa.ForeignKey("l2gatewayconnections.id", - ondelete="CASCADE"), nullable=False, primary_key=True) port_id = sa.Column(sa.String(36),