neutron.db.model_base.BASEV2 defines __table_args__ attribute. Its
subclasses overloading __table_args__ should inherit __table_args__ from
parent class.
A migration script is not needed as __table_args__ are not overloaded in
neutron.db.migration.models.frozen module.
Closes-Bug: #
1413985
Change-Id: Ied625252714e2e952f9831d0d03c4573306fe29d
__table_args__ = (
sa.UniqueConstraint('agent_type', 'host',
name='uniq_agents0agent_type0host'),
+ model_base.BASEV2.__table_args__
)
# L3 agent, DHCP agent, OVS agent, LinuxBridge
name='uniq_ipavailabilityranges0first_ip0allocation_pool_id'),
sa.UniqueConstraint(
last_ip, allocation_pool_id,
- name='uniq_ipavailabilityranges0last_ip0allocation_pool_id'))
+ name='uniq_ipavailabilityranges0last_ip0allocation_pool_id'),
+ model_base.BASEV2.__table_args__
+ )
def __repr__(self):
return "%s - %s" % (self.first_ip, self.last_ip)
__table_args__ = (
sa.UniqueConstraint('host',
name='unique_ml2_gre_endpoints0host'),
+ model_base.BASEV2.__table_args__
)
ip_address = sa.Column(sa.String(64), primary_key=True)
host = sa.Column(sa.String(255), nullable=True)
__table_args__ = (
sa.UniqueConstraint('host',
name='unique_ml2_vxlan_endpoints0host'),
+ model_base.BASEV2.__table_args__
)
ip_address = sa.Column(sa.String(64), primary_key=True)
udp_port = sa.Column(sa.Integer, nullable=False)
segmentation_id = sa.Column(sa.Integer)
__table_args__ = (sa.UniqueConstraint(network_gateway_id,
segmentation_type,
- segmentation_id),)
+ segmentation_id),
+ model_base.BASEV2.__table_args__)
# Also, storing port id comes back useful when disconnecting a network
# from a gateway
port_id = sa.Column(sa.String(36),
primary_key=True)
device_id = sa.Column(sa.String(255), nullable=False)
index = sa.Column(sa.Integer, nullable=False)
- __table_args__ = (sa.UniqueConstraint(device_id, index),)
+ __table_args__ = (sa.UniqueConstraint(device_id, index),
+ model_base.BASEV2.__table_args__)
# Add a relationship to the Port model in order to instruct SQLAlchemy to
# eagerly read port vnic-index