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
This commit is contained in:
parent
ff9a801bc2
commit
c57d5d8efc
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user