From e416a5420f45391c180f84098f4d2c02ecf857b9 Mon Sep 17 00:00:00 2001 From: Jakub Libosvar Date: Tue, 22 Jul 2014 15:22:24 +0200 Subject: [PATCH] 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 --- neutron/plugins/vmware/dbexts/models.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/neutron/plugins/vmware/dbexts/models.py b/neutron/plugins/vmware/dbexts/models.py index 53bf24f2049..47d735c3ed2 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