From: Jakub Libosvar Date: Tue, 22 Jul 2014 13:22:24 +0000 (+0200) Subject: Replace nullable from primary keys in tz_network_bindings with default X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=e416a5420f45391c180f84098f4d2c02ecf857b9;p=openstack-build%2Fneutron-build.git Replace nullable from primary keys in tz_network_bindings with default Columns vlan_id and phy_uuid were both nullable and primary keys. Primary keys cannot be nulls. This situation caused problems in autogenerating scripts creating always migration that set these columns to nullable. Instead of having primary keys nullable this patch creates a default values. Change-Id: I04642f6d6ad232997a593bff8ca44f9a7a803ffd Closes-bug: #1346900 --- diff --git a/neutron/plugins/vmware/dbexts/models.py b/neutron/plugins/vmware/dbexts/models.py index 53bf24f20..47d735c3e 100644 --- a/neutron/plugins/vmware/dbexts/models.py +++ b/neutron/plugins/vmware/dbexts/models.py @@ -40,9 +40,8 @@ class TzNetworkBinding(model_base.BASEV2): binding_type = Column(Enum('flat', 'vlan', 'stt', 'gre', 'l3_ext', name='tz_network_bindings_binding_type'), nullable=False, primary_key=True) - phy_uuid = Column(String(36), primary_key=True, nullable=True) - vlan_id = Column(Integer, primary_key=True, nullable=True, - autoincrement=False) + phy_uuid = Column(String(36), primary_key=True, default='') + vlan_id = Column(Integer, primary_key=True, autoincrement=False, default=0) def __init__(self, network_id, binding_type, phy_uuid, vlan_id): self.network_id = network_id