diff --git a/neutron/plugins/vmware/dbexts/lsn_db.py b/neutron/plugins/vmware/dbexts/lsn_db.py index 30a3bda805..25a457ac7d 100644 --- a/neutron/plugins/vmware/dbexts/lsn_db.py +++ b/neutron/plugins/vmware/dbexts/lsn_db.py @@ -35,7 +35,8 @@ class LsnPort(models_v2.model_base.BASEV2): lsn_port_id = Column(String(36), primary_key=True) - lsn_id = Column(String(36), ForeignKey('lsn.lsn_id', ondelete="CASCADE")) + lsn_id = Column(String(36), ForeignKey('lsn.lsn_id', ondelete="CASCADE"), + nullable=False) sub_id = Column(String(36), nullable=False, unique=True) mac_addr = Column(String(32), nullable=False, unique=True) diff --git a/neutron/plugins/vmware/dbexts/models.py b/neutron/plugins/vmware/dbexts/models.py index 69c146be91..3563328118 100644 --- a/neutron/plugins/vmware/dbexts/models.py +++ b/neutron/plugins/vmware/dbexts/models.py @@ -91,7 +91,7 @@ class NeutronNsxPortMapping(model_base.BASEV2): ForeignKey('ports.id', ondelete="CASCADE"), primary_key=True) nsx_switch_id = Column(String(36)) - nsx_port_id = Column(String(36)) + nsx_port_id = Column(String(36), nullable=False) def __init__(self, neutron_id, nsx_switch_id, nsx_port_id): self.neutron_id = neutron_id