Merge "pyupgrade changes for Python3.8+ (5)"

This commit is contained in:
Zuul 2024-04-15 10:46:23 +00:00 committed by Gerrit Code Review
commit ce29065796
73 changed files with 598 additions and 598 deletions

View File

@ -143,29 +143,29 @@ class OctaviaBase(models.ModelBase):
return f"{self.__class__.__name__}({params})" return f"{self.__class__.__name__}({params})"
class LookupTableMixin(object): class LookupTableMixin:
"""Mixin to add to classes that are lookup tables.""" """Mixin to add to classes that are lookup tables."""
name = sa.Column(sa.String(255), primary_key=True, nullable=False) name = sa.Column(sa.String(255), primary_key=True, nullable=False)
description = sa.Column(sa.String(255), nullable=True) description = sa.Column(sa.String(255), nullable=True)
class IdMixin(object): class IdMixin:
"""Id mixin, add to subclasses that have an id.""" """Id mixin, add to subclasses that have an id."""
id = sa.Column(sa.String(36), primary_key=True, id = sa.Column(sa.String(36), primary_key=True,
default=uuidutils.generate_uuid) default=uuidutils.generate_uuid)
class ProjectMixin(object): class ProjectMixin:
"""Tenant mixin, add to subclasses that have a project.""" """Tenant mixin, add to subclasses that have a project."""
project_id = sa.Column(sa.String(36)) project_id = sa.Column(sa.String(36))
class NameMixin(object): class NameMixin:
"""Name mixin to add to classes which need a name.""" """Name mixin to add to classes which need a name."""
name = sa.Column(sa.String(255), nullable=True) name = sa.Column(sa.String(255), nullable=True)
class TagMixin(object): class TagMixin:
"""Tags mixin to add to classes which need tags. """Tags mixin to add to classes which need tags.
The class must realize the specified db relationship as well. The class must realize the specified db relationship as well.

View File

@ -30,6 +30,6 @@ down_revision = '10d38216ad34'
def upgrade(): def upgrade():
op.add_column( op.add_column(
u'amphora', 'amphora',
sa.Column(u'image_id', sa.String(36), nullable=True) sa.Column('image_id', sa.String(36), nullable=True)
) )

View File

@ -33,33 +33,33 @@ down_revision = 'fac584114642'
def upgrade(): def upgrade():
# Add timing data # Add timing data
op.add_column( op.add_column(
u'l7policy', 'l7policy',
sa.Column(u'created_at', sa.DateTime(), nullable=True) sa.Column('created_at', sa.DateTime(), nullable=True)
) )
op.add_column( op.add_column(
u'l7policy', 'l7policy',
sa.Column(u'updated_at', sa.DateTime(), nullable=True) sa.Column('updated_at', sa.DateTime(), nullable=True)
) )
# Add project_id # Add project_id
op.add_column( op.add_column(
u'l7policy', 'l7policy',
sa.Column(u'project_id', sa.String(36), nullable=True) sa.Column('project_id', sa.String(36), nullable=True)
) )
# Add new operating_status column, setting existing rows to ONLINE # Add new operating_status column, setting existing rows to ONLINE
op.add_column( op.add_column(
u'l7policy', 'l7policy',
sa.Column(u'operating_status', sa.String(16), sa.Column('operating_status', sa.String(16),
nullable=False, server_default=constants.ONLINE) nullable=False, server_default=constants.ONLINE)
) )
# Remove the default, as we don't actually want one # Remove the default, as we don't actually want one
op.alter_column(u'l7policy', u'operating_status', op.alter_column('l7policy', 'operating_status',
existing_type=sa.String(16), server_default=None) existing_type=sa.String(16), server_default=None)
# Add the foreign key for operating_status_name # Add the foreign key for operating_status_name
op.create_foreign_key( op.create_foreign_key(
u'fk_l7policy_operating_status_name', u'l7policy', 'fk_l7policy_operating_status_name', 'l7policy',
u'operating_status', [u'operating_status'], [u'name'] 'operating_status', ['operating_status'], ['name']
) )
op.drop_constraint('fk_health_monitor_provisioning_status_name', op.drop_constraint('fk_health_monitor_provisioning_status_name',
@ -83,59 +83,59 @@ def upgrade():
type_='foreignkey') type_='foreignkey')
# provisioning_status was mistakenly added as nullable, the fix is similar # provisioning_status was mistakenly added as nullable, the fix is similar
op.alter_column(u'l7policy', u'provisioning_status', nullable=False, op.alter_column('l7policy', 'provisioning_status', nullable=False,
existing_type=sa.String(16), existing_type=sa.String(16),
server_default=constants.ACTIVE) server_default=constants.ACTIVE)
op.alter_column(u'l7policy', u'provisioning_status', op.alter_column('l7policy', 'provisioning_status',
existing_type=sa.String(16), server_default=None) existing_type=sa.String(16), server_default=None)
# Fix the rest of these that were also mistakenly set as nullable in: # Fix the rest of these that were also mistakenly set as nullable in:
# 9b5473976d6d_add_provisioning_status_to_objects.py # 9b5473976d6d_add_provisioning_status_to_objects.py
op.alter_column(u'health_monitor', u'provisioning_status', nullable=False, op.alter_column('health_monitor', 'provisioning_status', nullable=False,
existing_type=sa.String(16), existing_type=sa.String(16),
server_default=constants.ACTIVE) server_default=constants.ACTIVE)
op.alter_column(u'health_monitor', u'provisioning_status', op.alter_column('health_monitor', 'provisioning_status',
existing_type=sa.String(16), server_default=None) existing_type=sa.String(16), server_default=None)
op.alter_column(u'member', u'provisioning_status', nullable=False, op.alter_column('member', 'provisioning_status', nullable=False,
existing_type=sa.String(16), existing_type=sa.String(16),
server_default=constants.ACTIVE) server_default=constants.ACTIVE)
op.alter_column(u'member', u'provisioning_status', op.alter_column('member', 'provisioning_status',
existing_type=sa.String(16), server_default=None) existing_type=sa.String(16), server_default=None)
op.alter_column(u'pool', u'provisioning_status', nullable=False, op.alter_column('pool', 'provisioning_status', nullable=False,
existing_type=sa.String(16), existing_type=sa.String(16),
server_default=constants.ACTIVE) server_default=constants.ACTIVE)
op.alter_column(u'pool', u'provisioning_status', op.alter_column('pool', 'provisioning_status',
existing_type=sa.String(16), server_default=None) existing_type=sa.String(16), server_default=None)
op.alter_column(u'l7rule', u'provisioning_status', nullable=False, op.alter_column('l7rule', 'provisioning_status', nullable=False,
existing_type=sa.String(16), existing_type=sa.String(16),
server_default=constants.ACTIVE) server_default=constants.ACTIVE)
op.alter_column(u'l7rule', u'provisioning_status', op.alter_column('l7rule', 'provisioning_status',
existing_type=sa.String(16), server_default=None) existing_type=sa.String(16), server_default=None)
op.create_foreign_key( op.create_foreign_key(
u'fk_health_monitor_provisioning_status_name', u'health_monitor', 'fk_health_monitor_provisioning_status_name', 'health_monitor',
u'provisioning_status', [u'provisioning_status'], [u'name'] 'provisioning_status', ['provisioning_status'], ['name']
) )
op.create_foreign_key( op.create_foreign_key(
u'fk_l7policy_provisioning_status_name', u'l7policy', 'fk_l7policy_provisioning_status_name', 'l7policy',
u'provisioning_status', [u'provisioning_status'], [u'name'] 'provisioning_status', ['provisioning_status'], ['name']
) )
op.create_foreign_key( op.create_foreign_key(
u'fk_l7rule_provisioning_status_name', u'l7rule', 'fk_l7rule_provisioning_status_name', 'l7rule',
u'provisioning_status', [u'provisioning_status'], [u'name'] 'provisioning_status', ['provisioning_status'], ['name']
) )
op.create_foreign_key( op.create_foreign_key(
u'fk_member_provisioning_status_name', u'member', 'fk_member_provisioning_status_name', 'member',
u'provisioning_status', [u'provisioning_status'], [u'name'] 'provisioning_status', ['provisioning_status'], ['name']
) )
op.create_foreign_key( op.create_foreign_key(
u'fk_pool_provisioning_status_name', u'pool', 'fk_pool_provisioning_status_name', 'pool',
u'provisioning_status', [u'provisioning_status'], [u'name'] 'provisioning_status', ['provisioning_status'], ['name']
) )

View File

@ -30,8 +30,8 @@ down_revision = '0fd2c131923f'
def upgrade(): def upgrade():
op.add_column( op.add_column(
u'load_balancer', 'load_balancer',
sa.Column(u'provider', sa.String(64), nullable=True) sa.Column('provider', sa.String(64), nullable=True)
) )
op.execute("UPDATE load_balancer set provider='amphora' where provider " op.execute("UPDATE load_balancer set provider='amphora' where provider "
"is null") "is null")

View File

@ -30,10 +30,10 @@ down_revision = '0aee2b450512'
def upgrade(): def upgrade():
op.add_column( op.add_column(
u'amphora', 'amphora',
sa.Column(u'created_at', sa.DateTime(), nullable=True) sa.Column('created_at', sa.DateTime(), nullable=True)
) )
op.add_column( op.add_column(
u'amphora', 'amphora',
sa.Column(u'updated_at', sa.DateTime(), nullable=True) sa.Column('updated_at', sa.DateTime(), nullable=True)
) )

View File

@ -27,4 +27,4 @@ down_revision = '211982b05afc'
def upgrade(): def upgrade():
op.alter_column(u'vip', u'ip_address', type_=sa.String(64)) op.alter_column('vip', 'ip_address', type_=sa.String(64))

View File

@ -29,15 +29,15 @@ down_revision = '4c094013699a'
def upgrade(): def upgrade():
op.alter_column(u'provisioning_status', u'name', op.alter_column('provisioning_status', 'name',
existing_type=sa.String(255)) existing_type=sa.String(255))
op.alter_column(u'operating_status', u'name', op.alter_column('operating_status', 'name',
existing_type=sa.String(255)) existing_type=sa.String(255))
op.alter_column(u'health_monitor_type', u'name', op.alter_column('health_monitor_type', 'name',
existing_type=sa.String(255)) existing_type=sa.String(255))
op.alter_column(u'protocol', u'name', op.alter_column('protocol', 'name',
existing_type=sa.String(255)) existing_type=sa.String(255))
op.alter_column(u'algorithm', u'name', op.alter_column('algorithm', 'name',
existing_type=sa.String(255)) existing_type=sa.String(255))
op.alter_column(u'session_persistence_type', u'name', op.alter_column('session_persistence_type', 'name',
existing_type=sa.String(255)) existing_type=sa.String(255))

View File

@ -29,10 +29,10 @@ down_revision = '3a1e1cdb7b27'
def upgrade(): def upgrade():
with op.batch_alter_table(u'vip') as batch_op: with op.batch_alter_table('vip') as batch_op:
batch_op.alter_column(u'subnet_id', new_column_name=u'network_id', batch_op.alter_column('subnet_id', new_column_name='network_id',
existing_type=sa.String(36)) existing_type=sa.String(36))
batch_op.alter_column(u'net_port_id', new_column_name=u'port_id', batch_op.alter_column('net_port_id', new_column_name='port_id',
existing_type=sa.String(36)) existing_type=sa.String(36))
batch_op.drop_column(u'floating_ip_id') batch_op.drop_column('floating_ip_id')
batch_op.drop_column(u'floating_ip_network_id') batch_op.drop_column('floating_ip_network_id')

View File

@ -30,5 +30,5 @@ down_revision = '458c9ee2a011'
def upgrade(): def upgrade():
op.add_column(u'load_balancer', sa.Column(u'server_group_id', op.add_column('load_balancer', sa.Column('server_group_id',
sa.String(36), nullable=True)) sa.String(36), nullable=True))

View File

@ -36,9 +36,9 @@ new_fields = ['SSL_CONN_HAS_CERT', 'SSL_VERIFY_RESULT', 'SSL_DN_FIELD']
def upgrade(): def upgrade():
insert_table = sql.table( insert_table = sql.table(
u'l7rule_type', 'l7rule_type',
sql.column(u'name', sa.String), sql.column('name', sa.String),
sql.column(u'description', sa.String) sql.column('description', sa.String)
) )
cows = [{'name': field} for field in new_fields] cows = [{'name': field} for field in new_fields]
op.bulk_insert(insert_table, cows) op.bulk_insert(insert_table, cows)

View File

@ -30,15 +30,15 @@ down_revision = '5a3ee5472c31'
def upgrade(): def upgrade():
op.create_table( op.create_table(
u'vrrp_auth_method', 'vrrp_auth_method',
sa.Column(u'name', sa.String(36), primary_key=True), sa.Column('name', sa.String(36), primary_key=True),
sa.Column(u'description', sa.String(255), nullable=True) sa.Column('description', sa.String(255), nullable=True)
) )
insert_table = sql.table( insert_table = sql.table(
u'vrrp_auth_method', 'vrrp_auth_method',
sql.column(u'name', sa.String), sql.column('name', sa.String),
sql.column(u'description', sa.String) sql.column('description', sa.String)
) )
op.bulk_insert( op.bulk_insert(
@ -50,36 +50,36 @@ def upgrade():
) )
op.create_table( op.create_table(
u'vrrp_group', 'vrrp_group',
sa.Column(u'load_balancer_id', sa.String(36), nullable=False), sa.Column('load_balancer_id', sa.String(36), nullable=False),
sa.Column(u'vrrp_group_name', sa.String(36), nullable=True), sa.Column('vrrp_group_name', sa.String(36), nullable=True),
sa.Column(u'vrrp_auth_type', sa.String(16), nullable=True), sa.Column('vrrp_auth_type', sa.String(16), nullable=True),
sa.Column(u'vrrp_auth_pass', sa.String(36), nullable=True), sa.Column('vrrp_auth_pass', sa.String(36), nullable=True),
sa.Column(u'advert_int', sa.Integer(), nullable=True), sa.Column('advert_int', sa.Integer(), nullable=True),
sa.PrimaryKeyConstraint(u'load_balancer_id'), sa.PrimaryKeyConstraint('load_balancer_id'),
sa.ForeignKeyConstraint([u'load_balancer_id'], [u'load_balancer.id'], sa.ForeignKeyConstraint(['load_balancer_id'], ['load_balancer.id'],
name=u'fk_vrrp_group_load_balancer_id'), name='fk_vrrp_group_load_balancer_id'),
sa.ForeignKeyConstraint([u'vrrp_auth_type'], sa.ForeignKeyConstraint(['vrrp_auth_type'],
[u'vrrp_auth_method.name'], ['vrrp_auth_method.name'],
name=u'fk_load_balancer_vrrp_auth_method_name') name='fk_load_balancer_vrrp_auth_method_name')
) )
op.add_column( op.add_column(
u'listener', 'listener',
sa.Column(u'peer_port', sa.Integer(), nullable=True) sa.Column('peer_port', sa.Integer(), nullable=True)
) )
op.add_column( op.add_column(
u'amphora', 'amphora',
sa.Column(u'vrrp_interface', sa.String(16), nullable=True) sa.Column('vrrp_interface', sa.String(16), nullable=True)
) )
op.add_column( op.add_column(
u'amphora', 'amphora',
sa.Column(u'vrrp_id', sa.Integer(), nullable=True) sa.Column('vrrp_id', sa.Integer(), nullable=True)
) )
op.add_column( op.add_column(
u'amphora', 'amphora',
sa.Column(u'vrrp_priority', sa.Integer(), nullable=True) sa.Column('vrrp_priority', sa.Integer(), nullable=True)
) )

View File

@ -33,9 +33,9 @@ new_protocol = 'TERMINATED_HTTPS'
def upgrade(): def upgrade():
insert_table = sql.table( insert_table = sql.table(
u'protocol', 'protocol',
sql.column(u'name', sa.String), sql.column('name', sa.String),
sql.column(u'description', sa.String) sql.column('description', sa.String)
) )
op.bulk_insert( op.bulk_insert(
@ -44,5 +44,5 @@ def upgrade():
{'name': new_protocol} {'name': new_protocol}
] ]
) )
op.alter_column(u'listener', u'tls_certificate_id', op.alter_column('listener', 'tls_certificate_id',
existing_type=sa.String(255), nullable=True) existing_type=sa.String(255), nullable=True)

View File

@ -29,5 +29,5 @@ down_revision = '14892634e228'
def upgrade(): def upgrade():
op.add_column(u'amphora', sa.Column(u'lb_network_ip', sa.String(64), op.add_column('amphora', sa.Column('lb_network_ip', sa.String(64),
nullable=True)) nullable=True))

View File

@ -30,13 +30,13 @@ down_revision = '5309960964f8'
def upgrade(): def upgrade():
op.add_column(u'member', op.add_column('member',
sa.Column(u'monitor_address', sa.Column('monitor_address',
sa.String(64), sa.String(64),
nullable=True) nullable=True)
) )
op.add_column(u'member', op.add_column('member',
sa.Column(u'monitor_port', sa.Column('monitor_port',
sa.Integer(), sa.Integer(),
nullable=True) nullable=True)
) )

View File

@ -29,7 +29,7 @@ down_revision = '4fe8240425b4'
def upgrade(): def upgrade():
op.add_column(u'amphora', op.add_column('amphora',
sa.Column(u'vrrp_port_id', sa.String(36), nullable=True)) sa.Column('vrrp_port_id', sa.String(36), nullable=True))
op.add_column(u'amphora', op.add_column('amphora',
sa.Column(u'ha_port_id', sa.String(36), nullable=True)) sa.Column('ha_port_id', sa.String(36), nullable=True))

View File

@ -49,7 +49,7 @@ def upgrade():
op.create_foreign_key('fk_listener_pool_id', 'listener', op.create_foreign_key('fk_listener_pool_id', 'listener',
'pool', ['default_pool_id'], ['id']) 'pool', ['default_pool_id'], ['id'])
op.add_column(u'pool', op.add_column('pool',
sa.Column('load_balancer_id', sa.String(36), sa.Column('load_balancer_id', sa.String(36),
sa.ForeignKey('load_balancer.id'), nullable=True)) sa.ForeignKey('load_balancer.id'), nullable=True))

View File

@ -31,7 +31,7 @@ down_revision = '11e4bb2bb8ef'
def upgrade(): def upgrade():
op.add_column( op.add_column(
u'listener', 'listener',
sa.Column(u'client_ca_tls_certificate_id', sa.String(255), sa.Column('client_ca_tls_certificate_id', sa.String(255),
nullable=True) nullable=True)
) )

View File

@ -30,15 +30,15 @@ down_revision = '6ac558d7fc21'
def upgrade(): def upgrade():
op.create_table( op.create_table(
u'additional_vip', 'additional_vip',
sa.Column(u'load_balancer_id', sa.String(36), nullable=False, sa.Column('load_balancer_id', sa.String(36), nullable=False,
index=True), index=True),
sa.Column(u'ip_address', sa.String(64), nullable=True), sa.Column('ip_address', sa.String(64), nullable=True),
sa.Column(u'port_id', sa.String(36), nullable=True), sa.Column('port_id', sa.String(36), nullable=True),
sa.Column(u'subnet_id', sa.String(36), nullable=True), sa.Column('subnet_id', sa.String(36), nullable=True),
sa.Column(u'network_id', sa.String(36), nullable=True), sa.Column('network_id', sa.String(36), nullable=True),
sa.ForeignKeyConstraint([u'load_balancer_id'], [u'load_balancer.id'], sa.ForeignKeyConstraint(['load_balancer_id'], ['load_balancer.id'],
name=u'fk_add_vip_load_balancer_id'), name='fk_add_vip_load_balancer_id'),
sa.PrimaryKeyConstraint(u'load_balancer_id', u'subnet_id', sa.PrimaryKeyConstraint('load_balancer_id', 'subnet_id',
name=u'pk_add_vip_load_balancer_subnet'), name='pk_add_vip_load_balancer_subnet'),
) )

View File

@ -30,11 +30,11 @@ down_revision = 'd3c8a090f3de'
def upgrade(): def upgrade():
op.add_column(u'quotas', op.add_column('quotas',
sa.Column('l7policy', sa.Integer(), nullable=True)) sa.Column('l7policy', sa.Integer(), nullable=True))
op.add_column(u'quotas', op.add_column('quotas',
sa.Column('l7rule', sa.Integer(), nullable=True)) sa.Column('l7rule', sa.Integer(), nullable=True))
op.add_column(u'quotas', op.add_column('quotas',
sa.Column('in_use_l7policy', sa.Integer(), nullable=True)) sa.Column('in_use_l7policy', sa.Integer(), nullable=True))
op.add_column(u'quotas', op.add_column('quotas',
sa.Column('in_use_l7rule', sa.Integer(), nullable=True)) sa.Column('in_use_l7rule', sa.Integer(), nullable=True))

View File

@ -32,15 +32,15 @@ down_revision = '298eac0640a7'
def upgrade(): def upgrade():
op.create_table( op.create_table(
u'lb_topology', 'lb_topology',
sa.Column(u'name', sa.String(36), primary_key=True), sa.Column('name', sa.String(36), primary_key=True),
sa.Column(u'description', sa.String(255), nullable=True) sa.Column('description', sa.String(255), nullable=True)
) )
insert_table = sql.table( insert_table = sql.table(
u'lb_topology', 'lb_topology',
sql.column(u'name', sa.String), sql.column('name', sa.String),
sql.column(u'description', sa.String) sql.column('description', sa.String)
) )
op.bulk_insert( op.bulk_insert(
@ -52,15 +52,15 @@ def upgrade():
) )
op.create_table( op.create_table(
u'amphora_roles', 'amphora_roles',
sa.Column(u'name', sa.String(36), primary_key=True), sa.Column('name', sa.String(36), primary_key=True),
sa.Column(u'description', sa.String(255), nullable=True) sa.Column('description', sa.String(255), nullable=True)
) )
insert_table = sql.table( insert_table = sql.table(
u'amphora_roles', 'amphora_roles',
sql.column(u'name', sa.String), sql.column('name', sa.String),
sql.column(u'description', sa.String) sql.column('description', sa.String)
) )
op.bulk_insert( op.bulk_insert(
@ -73,17 +73,17 @@ def upgrade():
) )
op.add_column( op.add_column(
u'load_balancer', 'load_balancer',
sa.Column(u'topology', sa.String(36), sa.Column('topology', sa.String(36),
sa.ForeignKey(u'lb_topology.name', sa.ForeignKey('lb_topology.name',
name=u'fk_lb_topology_name'), name='fk_lb_topology_name'),
nullable=True) nullable=True)
) )
op.add_column( op.add_column(
u'amphora', 'amphora',
sa.Column(u'role', sa.String(36), sa.Column('role', sa.String(36),
sa.ForeignKey(u'amphora_roles.name', sa.ForeignKey('amphora_roles.name',
name=u'fk_amphora_roles_name'), name='fk_amphora_roles_name'),
nullable=True) nullable=True)
) )

View File

@ -32,16 +32,16 @@ down_revision = None
def upgrade(): def upgrade():
# Create lookup tables # Create lookup tables
op.create_table( op.create_table(
u'health_monitor_type', 'health_monitor_type',
sa.Column(u'name', sa.String(30), primary_key=True), sa.Column('name', sa.String(30), primary_key=True),
sa.Column(u'description', sa.String(255), nullable=True) sa.Column('description', sa.String(255), nullable=True)
) )
# Create temporary table for table data seeding # Create temporary table for table data seeding
insert_table = sql.table( insert_table = sql.table(
u'health_monitor_type', 'health_monitor_type',
sql.column(u'name', sa.String), sql.column('name', sa.String),
sql.column(u'description', sa.String) sql.column('description', sa.String)
) )
op.bulk_insert( op.bulk_insert(
@ -54,15 +54,15 @@ def upgrade():
) )
op.create_table( op.create_table(
u'protocol', 'protocol',
sa.Column(u'name', sa.String(30), primary_key=True), sa.Column('name', sa.String(30), primary_key=True),
sa.Column(u'description', sa.String(255), nullable=True) sa.Column('description', sa.String(255), nullable=True)
) )
insert_table = sql.table( insert_table = sql.table(
u'protocol', 'protocol',
sql.column(u'name', sa.String), sql.column('name', sa.String),
sql.column(u'description', sa.String) sql.column('description', sa.String)
) )
op.bulk_insert( op.bulk_insert(
@ -75,15 +75,15 @@ def upgrade():
) )
op.create_table( op.create_table(
u'algorithm', 'algorithm',
sa.Column(u'name', sa.String(30), primary_key=True), sa.Column('name', sa.String(30), primary_key=True),
sa.Column(u'description', sa.String(255), nullable=True) sa.Column('description', sa.String(255), nullable=True)
) )
insert_table = sql.table( insert_table = sql.table(
u'algorithm', 'algorithm',
sql.column(u'name', sa.String), sql.column('name', sa.String),
sql.column(u'description', sa.String) sql.column('description', sa.String)
) )
op.bulk_insert( op.bulk_insert(
@ -96,15 +96,15 @@ def upgrade():
) )
op.create_table( op.create_table(
u'session_persistence_type', 'session_persistence_type',
sa.Column(u'name', sa.String(30), primary_key=True), sa.Column('name', sa.String(30), primary_key=True),
sa.Column(u'description', sa.String(255), nullable=True) sa.Column('description', sa.String(255), nullable=True)
) )
insert_table = sql.table( insert_table = sql.table(
u'session_persistence_type', 'session_persistence_type',
sql.column(u'name', sa.String), sql.column('name', sa.String),
sql.column(u'description', sa.String) sql.column('description', sa.String)
) )
op.bulk_insert( op.bulk_insert(
@ -117,15 +117,15 @@ def upgrade():
) )
op.create_table( op.create_table(
u'provisioning_status', 'provisioning_status',
sa.Column(u'name', sa.String(30), primary_key=True), sa.Column('name', sa.String(30), primary_key=True),
sa.Column(u'description', sa.String(255), nullable=True) sa.Column('description', sa.String(255), nullable=True)
) )
insert_table = sql.table( insert_table = sql.table(
u'provisioning_status', 'provisioning_status',
sql.column(u'name', sa.String), sql.column('name', sa.String),
sql.column(u'description', sa.String) sql.column('description', sa.String)
) )
op.bulk_insert( op.bulk_insert(
@ -141,15 +141,15 @@ def upgrade():
) )
op.create_table( op.create_table(
u'operating_status', 'operating_status',
sa.Column(u'name', sa.String(30), primary_key=True), sa.Column('name', sa.String(30), primary_key=True),
sa.Column(u'description', sa.String(255), nullable=True) sa.Column('description', sa.String(255), nullable=True)
) )
insert_table = sql.table( insert_table = sql.table(
u'operating_status', 'operating_status',
sql.column(u'name', sa.String), sql.column('name', sa.String),
sql.column(u'description', sa.String) sql.column('description', sa.String)
) )
op.bulk_insert( op.bulk_insert(
@ -163,190 +163,190 @@ def upgrade():
) )
op.create_table( op.create_table(
u'pool', 'pool',
sa.Column(u'tenant_id', sa.String(255), nullable=True), sa.Column('tenant_id', sa.String(255), nullable=True),
sa.Column(u'id', sa.String(36), nullable=False), sa.Column('id', sa.String(36), nullable=False),
sa.Column(u'name', sa.String(255), nullable=True), sa.Column('name', sa.String(255), nullable=True),
sa.Column(u'description', sa.String(255), nullable=True), sa.Column('description', sa.String(255), nullable=True),
sa.Column(u'protocol', sa.String(16), nullable=False), sa.Column('protocol', sa.String(16), nullable=False),
sa.Column(u'lb_algorithm', sa.String(16), nullable=False), sa.Column('lb_algorithm', sa.String(16), nullable=False),
sa.Column(u'operating_status', sa.String(16), nullable=False), sa.Column('operating_status', sa.String(16), nullable=False),
sa.Column(u'enabled', sa.Boolean(), nullable=False), sa.Column('enabled', sa.Boolean(), nullable=False),
sa.PrimaryKeyConstraint(u'id'), sa.PrimaryKeyConstraint('id'),
sa.ForeignKeyConstraint([u'protocol'], sa.ForeignKeyConstraint(['protocol'],
[u'protocol.name'], ['protocol.name'],
name=u'fk_pool_protocol_name'), name='fk_pool_protocol_name'),
sa.ForeignKeyConstraint([u'lb_algorithm'], sa.ForeignKeyConstraint(['lb_algorithm'],
[u'algorithm.name'], ['algorithm.name'],
name=u'fk_pool_algorithm_name'), name='fk_pool_algorithm_name'),
sa.ForeignKeyConstraint([u'operating_status'], sa.ForeignKeyConstraint(['operating_status'],
[u'operating_status.name'], ['operating_status.name'],
name=u'fk_pool_operating_status_name') name='fk_pool_operating_status_name')
) )
op.create_table( op.create_table(
u'health_monitor', 'health_monitor',
sa.Column(u'pool_id', sa.String(36), nullable=False), sa.Column('pool_id', sa.String(36), nullable=False),
sa.Column(u'type', sa.String(36), nullable=False), sa.Column('type', sa.String(36), nullable=False),
sa.Column(u'delay', sa.Integer(), nullable=False), sa.Column('delay', sa.Integer(), nullable=False),
sa.Column(u'timeout', sa.Integer(), nullable=False), sa.Column('timeout', sa.Integer(), nullable=False),
sa.Column(u'fall_threshold', sa.Integer(), nullable=False), sa.Column('fall_threshold', sa.Integer(), nullable=False),
sa.Column(u'rise_threshold', sa.Integer(), nullable=False), sa.Column('rise_threshold', sa.Integer(), nullable=False),
sa.Column(u'http_method', sa.String(16), nullable=True), sa.Column('http_method', sa.String(16), nullable=True),
sa.Column(u'url_path', sa.String(255), nullable=True), sa.Column('url_path', sa.String(255), nullable=True),
sa.Column(u'expected_codes', sa.String(64), nullable=True), sa.Column('expected_codes', sa.String(64), nullable=True),
sa.Column(u'enabled', sa.Boolean(), nullable=False), sa.Column('enabled', sa.Boolean(), nullable=False),
sa.PrimaryKeyConstraint(u'pool_id'), sa.PrimaryKeyConstraint('pool_id'),
sa.ForeignKeyConstraint([u'pool_id'], [u'pool.id'], sa.ForeignKeyConstraint(['pool_id'], ['pool.id'],
name=u'fk_health_monitor_pool_id'), name='fk_health_monitor_pool_id'),
sa.ForeignKeyConstraint( sa.ForeignKeyConstraint(
[u'type'], [u'health_monitor_type.name'], ['type'], ['health_monitor_type.name'],
name=u'fk_health_monitor_health_monitor_type_name') name='fk_health_monitor_health_monitor_type_name')
) )
op.create_table( op.create_table(
u'session_persistence', 'session_persistence',
sa.Column(u'pool_id', sa.String(36), nullable=False), sa.Column('pool_id', sa.String(36), nullable=False),
sa.Column(u'type', sa.String(16), nullable=False), sa.Column('type', sa.String(16), nullable=False),
sa.Column(u'cookie_name', sa.String(255), nullable=True), sa.Column('cookie_name', sa.String(255), nullable=True),
sa.ForeignKeyConstraint( sa.ForeignKeyConstraint(
[u'type'], [u'session_persistence_type.name'], ['type'], ['session_persistence_type.name'],
name=u'fk_session_persistence_session_persistence_type_name'), name='fk_session_persistence_session_persistence_type_name'),
sa.ForeignKeyConstraint([u'pool_id'], [u'pool.id'], sa.ForeignKeyConstraint(['pool_id'], ['pool.id'],
name=u'fk_session_persistence_pool_id'), name='fk_session_persistence_pool_id'),
sa.PrimaryKeyConstraint(u'pool_id') sa.PrimaryKeyConstraint('pool_id')
) )
op.create_table( op.create_table(
u'member', 'member',
sa.Column(u'tenant_id', sa.String(255), nullable=True), sa.Column('tenant_id', sa.String(255), nullable=True),
sa.Column(u'id', sa.String(36), nullable=False), sa.Column('id', sa.String(36), nullable=False),
sa.Column(u'pool_id', sa.String(36), nullable=False), sa.Column('pool_id', sa.String(36), nullable=False),
sa.Column(u'subnet_id', sa.String(36), nullable=True), sa.Column('subnet_id', sa.String(36), nullable=True),
sa.Column(u'address', sa.String(64), nullable=False), sa.Column('address', sa.String(64), nullable=False),
sa.Column(u'protocol_port', sa.Integer(), nullable=False), sa.Column('protocol_port', sa.Integer(), nullable=False),
sa.Column(u'weight', sa.Integer(), nullable=True), sa.Column('weight', sa.Integer(), nullable=True),
sa.Column(u'operating_status', sa.String(16), nullable=False), sa.Column('operating_status', sa.String(16), nullable=False),
sa.Column(u'enabled', sa.Boolean(), nullable=False), sa.Column('enabled', sa.Boolean(), nullable=False),
sa.PrimaryKeyConstraint(u'id'), sa.PrimaryKeyConstraint('id'),
sa.ForeignKeyConstraint([u'pool_id'], [u'pool.id'], sa.ForeignKeyConstraint(['pool_id'], ['pool.id'],
name=u'fk_member_pool_id'), name='fk_member_pool_id'),
sa.ForeignKeyConstraint([u'operating_status'], sa.ForeignKeyConstraint(['operating_status'],
[u'operating_status.name'], ['operating_status.name'],
name=u'fk_member_operating_status_name'), name='fk_member_operating_status_name'),
sa.UniqueConstraint(u'pool_id', u'address', u'protocol_port', sa.UniqueConstraint('pool_id', 'address', 'protocol_port',
name=u'uq_member_pool_id_address_protocol_port') name='uq_member_pool_id_address_protocol_port')
) )
op.create_table( op.create_table(
u'load_balancer', 'load_balancer',
sa.Column(u'tenant_id', sa.String(255), nullable=True), sa.Column('tenant_id', sa.String(255), nullable=True),
sa.Column(u'id', sa.String(36), nullable=False), sa.Column('id', sa.String(36), nullable=False),
sa.Column(u'name', sa.String(255), nullable=True), sa.Column('name', sa.String(255), nullable=True),
sa.Column(u'description', sa.String(255), nullable=True), sa.Column('description', sa.String(255), nullable=True),
sa.Column(u'provisioning_status', sa.String(16), nullable=False), sa.Column('provisioning_status', sa.String(16), nullable=False),
sa.Column(u'operating_status', sa.String(16), nullable=False), sa.Column('operating_status', sa.String(16), nullable=False),
sa.Column(u'enabled', sa.Boolean(), nullable=False), sa.Column('enabled', sa.Boolean(), nullable=False),
sa.PrimaryKeyConstraint(u'id'), sa.PrimaryKeyConstraint('id'),
sa.ForeignKeyConstraint( sa.ForeignKeyConstraint(
[u'provisioning_status'], [u'provisioning_status.name'], ['provisioning_status'], ['provisioning_status.name'],
name=u'fk_load_balancer_provisioning_status_name'), name='fk_load_balancer_provisioning_status_name'),
sa.ForeignKeyConstraint([u'operating_status'], sa.ForeignKeyConstraint(['operating_status'],
[u'operating_status.name'], ['operating_status.name'],
name=u'fk_load_balancer_operating_status_name') name='fk_load_balancer_operating_status_name')
) )
op.create_table( op.create_table(
u'vip', 'vip',
sa.Column(u'load_balancer_id', sa.String(36), nullable=False), sa.Column('load_balancer_id', sa.String(36), nullable=False),
sa.Column(u'ip_address', sa.String(36), nullable=True), sa.Column('ip_address', sa.String(36), nullable=True),
sa.Column(u'net_port_id', sa.String(36), nullable=True), sa.Column('net_port_id', sa.String(36), nullable=True),
sa.Column(u'subnet_id', sa.String(36), nullable=True), sa.Column('subnet_id', sa.String(36), nullable=True),
sa.Column(u'floating_ip_id', sa.String(36), nullable=True), sa.Column('floating_ip_id', sa.String(36), nullable=True),
sa.Column(u'floating_ip_network_id', sa.String(36), nullable=True), sa.Column('floating_ip_network_id', sa.String(36), nullable=True),
sa.PrimaryKeyConstraint(u'load_balancer_id'), sa.PrimaryKeyConstraint('load_balancer_id'),
sa.ForeignKeyConstraint([u'load_balancer_id'], [u'load_balancer.id'], sa.ForeignKeyConstraint(['load_balancer_id'], ['load_balancer.id'],
name=u'fk_vip_load_balancer_id') name='fk_vip_load_balancer_id')
) )
op.create_table( op.create_table(
u'listener', 'listener',
sa.Column(u'tenant_id', sa.String(255), nullable=True), sa.Column('tenant_id', sa.String(255), nullable=True),
sa.Column(u'id', sa.String(36), nullable=False), sa.Column('id', sa.String(36), nullable=False),
sa.Column(u'name', sa.String(255), nullable=True), sa.Column('name', sa.String(255), nullable=True),
sa.Column(u'description', sa.String(255), nullable=True), sa.Column('description', sa.String(255), nullable=True),
sa.Column(u'protocol', sa.String(16), nullable=False), sa.Column('protocol', sa.String(16), nullable=False),
sa.Column(u'protocol_port', sa.Integer(), nullable=False), sa.Column('protocol_port', sa.Integer(), nullable=False),
sa.Column(u'connection_limit', sa.Integer(), nullable=True), sa.Column('connection_limit', sa.Integer(), nullable=True),
sa.Column(u'load_balancer_id', sa.String(36), nullable=True), sa.Column('load_balancer_id', sa.String(36), nullable=True),
sa.Column(u'tls_certificate_id', sa.String(36), nullable=True), sa.Column('tls_certificate_id', sa.String(36), nullable=True),
sa.Column(u'default_pool_id', sa.String(36), nullable=True), sa.Column('default_pool_id', sa.String(36), nullable=True),
sa.Column(u'provisioning_status', sa.String(16), nullable=False), sa.Column('provisioning_status', sa.String(16), nullable=False),
sa.Column(u'operating_status', sa.String(16), nullable=False), sa.Column('operating_status', sa.String(16), nullable=False),
sa.Column(u'enabled', sa.Boolean(), nullable=False), sa.Column('enabled', sa.Boolean(), nullable=False),
sa.ForeignKeyConstraint([u'load_balancer_id'], [u'load_balancer.id'], sa.ForeignKeyConstraint(['load_balancer_id'], ['load_balancer.id'],
name=u'fk_listener_load_balancer_id'), name='fk_listener_load_balancer_id'),
sa.ForeignKeyConstraint([u'default_pool_id'], [u'pool.id'], sa.ForeignKeyConstraint(['default_pool_id'], ['pool.id'],
name=u'fk_listener_pool_id'), name='fk_listener_pool_id'),
sa.ForeignKeyConstraint([u'protocol'], [u'protocol.name'], sa.ForeignKeyConstraint(['protocol'], ['protocol.name'],
name=u'fk_listener_protocol_name'), name='fk_listener_protocol_name'),
sa.ForeignKeyConstraint([u'provisioning_status'], sa.ForeignKeyConstraint(['provisioning_status'],
[u'provisioning_status.name'], ['provisioning_status.name'],
name=u'fk_listener_provisioning_status_name'), name='fk_listener_provisioning_status_name'),
sa.ForeignKeyConstraint([u'operating_status'], sa.ForeignKeyConstraint(['operating_status'],
[u'operating_status.name'], ['operating_status.name'],
name=u'fk_listener_operating_status_name'), name='fk_listener_operating_status_name'),
sa.UniqueConstraint(u'default_pool_id', sa.UniqueConstraint('default_pool_id',
name=u'uq_listener_default_pool_id'), name='uq_listener_default_pool_id'),
sa.UniqueConstraint( sa.UniqueConstraint(
u'load_balancer_id', u'protocol_port', 'load_balancer_id', 'protocol_port',
name=u'uq_listener_load_balancer_id_protocol_port'), name='uq_listener_load_balancer_id_protocol_port'),
sa.PrimaryKeyConstraint(u'id') sa.PrimaryKeyConstraint('id')
) )
op.create_table( op.create_table(
u'sni', 'sni',
sa.Column(u'listener_id', sa.String(36), nullable=False), sa.Column('listener_id', sa.String(36), nullable=False),
sa.Column(u'tls_container_id', sa.String(36), nullable=False), sa.Column('tls_container_id', sa.String(36), nullable=False),
sa.Column(u'position', sa.Integer, nullable=True), sa.Column('position', sa.Integer, nullable=True),
sa.ForeignKeyConstraint([u'listener_id'], [u'listener.id'], sa.ForeignKeyConstraint(['listener_id'], ['listener.id'],
name=u'fk_sni_listener_id'), name='fk_sni_listener_id'),
sa.PrimaryKeyConstraint(u'listener_id', u'tls_container_id') sa.PrimaryKeyConstraint('listener_id', 'tls_container_id')
) )
op.create_table( op.create_table(
u'listener_statistics', 'listener_statistics',
sa.Column(u'listener_id', sa.String(36), nullable=False), sa.Column('listener_id', sa.String(36), nullable=False),
sa.Column(u'bytes_in', sa.BigInteger(), nullable=False), sa.Column('bytes_in', sa.BigInteger(), nullable=False),
sa.Column(u'bytes_out', sa.BigInteger(), nullable=False), sa.Column('bytes_out', sa.BigInteger(), nullable=False),
sa.Column(u'active_connections', sa.Integer(), nullable=False), sa.Column('active_connections', sa.Integer(), nullable=False),
sa.Column(u'total_connections', sa.BigInteger(), nullable=False), sa.Column('total_connections', sa.BigInteger(), nullable=False),
sa.PrimaryKeyConstraint(u'listener_id'), sa.PrimaryKeyConstraint('listener_id'),
sa.ForeignKeyConstraint([u'listener_id'], [u'listener.id'], sa.ForeignKeyConstraint(['listener_id'], ['listener.id'],
name=u'fk_listener_statistics_listener_id') name='fk_listener_statistics_listener_id')
) )
op.create_table( op.create_table(
u'amphora', 'amphora',
# id should come from the service providing the amphora (i.e. nova) # id should come from the service providing the amphora (i.e. nova)
sa.Column(u'id', sa.String(36), nullable=False, autoincrement=False), sa.Column('id', sa.String(36), nullable=False, autoincrement=False),
sa.Column(u'host_id', sa.String(36), nullable=False), sa.Column('host_id', sa.String(36), nullable=False),
sa.Column(u'status', sa.String(36), nullable=False), sa.Column('status', sa.String(36), nullable=False),
sa.PrimaryKeyConstraint(u'id'), sa.PrimaryKeyConstraint('id'),
sa.ForeignKeyConstraint( sa.ForeignKeyConstraint(
[u'status'], [u'provisioning_status.name'], ['status'], ['provisioning_status.name'],
name=u'fk_container_provisioning_status_name') name='fk_container_provisioning_status_name')
) )
op.create_table( op.create_table(
u'load_balancer_amphora', 'load_balancer_amphora',
sa.Column(u'amphora_id', sa.String(36), nullable=False), sa.Column('amphora_id', sa.String(36), nullable=False),
sa.Column(u'load_balancer_id', sa.String(36), nullable=False), sa.Column('load_balancer_id', sa.String(36), nullable=False),
sa.ForeignKeyConstraint( sa.ForeignKeyConstraint(
[u'load_balancer_id'], [u'load_balancer.id'], ['load_balancer_id'], ['load_balancer.id'],
name=u'fk_load_balancer_amphora_load_balancer_id'), name='fk_load_balancer_amphora_load_balancer_id'),
sa.ForeignKeyConstraint([u'amphora_id'], sa.ForeignKeyConstraint(['amphora_id'],
[u'amphora.id'], ['amphora.id'],
name=u'fk_load_balancer_amphora_id'), name='fk_load_balancer_amphora_id'),
sa.PrimaryKeyConstraint(u'amphora_id', u'load_balancer_id') sa.PrimaryKeyConstraint('amphora_id', 'load_balancer_id')
) )

View File

@ -34,9 +34,9 @@ def upgrade():
for table in tables: for table in tables:
op.add_column( op.add_column(
table, table,
sa.Column(u'created_at', sa.DateTime(), nullable=True) sa.Column('created_at', sa.DateTime(), nullable=True)
) )
op.add_column( op.add_column(
table, table,
sa.Column(u'updated_at', sa.DateTime(), nullable=True) sa.Column('updated_at', sa.DateTime(), nullable=True)
) )

View File

@ -39,7 +39,7 @@ def upgrade():
pk = inspector.get_pk_constraint('spares_pool') pk = inspector.get_pk_constraint('spares_pool')
if not pk['constrained_columns']: if not pk['constrained_columns']:
op.create_primary_key( op.create_primary_key(
u'pk_spares_pool', u'spares_pool', [u'updated_at']) 'pk_spares_pool', 'spares_pool', ['updated_at'])
else: else:
# Revision '46d914b2a5e5' has been updated to create the # Revision '46d914b2a5e5' has been updated to create the
# missing PK. Depending whether the env is already deployed or # missing PK. Depending whether the env is already deployed or

View File

@ -29,5 +29,5 @@ down_revision = '4faaa983e7a9'
def upgrade(): def upgrade():
op.alter_column(u'amphora', u'host_id', new_column_name='compute_id', op.alter_column('amphora', 'host_id', new_column_name='compute_id',
existing_type=sa.String(36), nullable=True) existing_type=sa.String(36), nullable=True)

View File

@ -29,7 +29,7 @@ down_revision = '92fe9857279'
def upgrade(): def upgrade():
op.add_column(u'amphora', op.add_column('amphora',
sa.Column(u'vrrp_ip', sa.String(64), nullable=True)) sa.Column('vrrp_ip', sa.String(64), nullable=True))
op.add_column(u'amphora', op.add_column('amphora',
sa.Column(u'ha_ip', sa.String(64), nullable=True)) sa.Column('ha_ip', sa.String(64), nullable=True))

View File

@ -29,17 +29,17 @@ down_revision = '44a2414dd683'
def upgrade(): def upgrade():
op.create_table( op.create_table(
u'quotas', 'quotas',
sa.Column(u'project_id', sa.String(36), primary_key=True, sa.Column('project_id', sa.String(36), primary_key=True,
nullable=False), nullable=False),
sa.Column(u'health_monitor', sa.Integer(), nullable=True), sa.Column('health_monitor', sa.Integer(), nullable=True),
sa.Column(u'load_balancer', sa.Integer(), nullable=True), sa.Column('load_balancer', sa.Integer(), nullable=True),
sa.Column(u'listener', sa.Integer(), nullable=True), sa.Column('listener', sa.Integer(), nullable=True),
sa.Column(u'member', sa.Integer(), nullable=True), sa.Column('member', sa.Integer(), nullable=True),
sa.Column(u'pool', sa.Integer(), nullable=True), sa.Column('pool', sa.Integer(), nullable=True),
sa.Column(u'in_use_health_monitor', sa.Integer(), nullable=True), sa.Column('in_use_health_monitor', sa.Integer(), nullable=True),
sa.Column(u'in_use_load_balancer', sa.Integer(), nullable=True), sa.Column('in_use_load_balancer', sa.Integer(), nullable=True),
sa.Column(u'in_use_listener', sa.Integer(), nullable=True), sa.Column('in_use_listener', sa.Integer(), nullable=True),
sa.Column(u'in_use_member', sa.Integer(), nullable=True), sa.Column('in_use_member', sa.Integer(), nullable=True),
sa.Column(u'in_use_pool', sa.Integer(), nullable=True), sa.Column('in_use_pool', sa.Integer(), nullable=True),
) )

View File

@ -30,14 +30,14 @@ down_revision = '6abb04f24c5'
def upgrade(): def upgrade():
op.drop_constraint( op.drop_constraint(
u'fk_pool_algorithm_name', u'pool', 'fk_pool_algorithm_name', 'pool',
type_=u'foreignkey' type_='foreignkey'
) )
op.alter_column(u'algorithm', u'name', nullable=False, op.alter_column('algorithm', 'name', nullable=False,
existing_type=sa.String(255)) existing_type=sa.String(255))
op.alter_column(u'pool', u'lb_algorithm', nullable=False, op.alter_column('pool', 'lb_algorithm', nullable=False,
existing_type=sa.String(255)) existing_type=sa.String(255))
op.create_foreign_key( op.create_foreign_key(
u'fk_pool_algorithm_name', u'pool', 'fk_pool_algorithm_name', 'pool',
u'algorithm', [u'lb_algorithm'], [u'name'] 'algorithm', ['lb_algorithm'], ['name']
) )

View File

@ -28,5 +28,5 @@ down_revision = '3f8ff3be828e'
def upgrade(): def upgrade():
op.add_column(u'vip', op.add_column('vip',
sa.Column(u'network_id', sa.String(36), nullable=True)) sa.Column('network_id', sa.String(36), nullable=True))

View File

@ -35,5 +35,5 @@ def upgrade():
for table in tables: for table in tables:
op.add_column( op.add_column(
table, table,
sa.Column(u'name', sa.String(255), nullable=True) sa.Column('name', sa.String(255), nullable=True)
) )

View File

@ -32,16 +32,16 @@ down_revision = '29ff921a6eb'
def upgrade(): def upgrade():
# L7 Rule Types # L7 Rule Types
op.create_table( op.create_table(
u'l7rule_type', 'l7rule_type',
sa.Column(u'name', sa.String(36), primary_key=True), sa.Column('name', sa.String(36), primary_key=True),
sa.Column(u'description', sa.String(255), nullable=True) sa.Column('description', sa.String(255), nullable=True)
) )
# Create temporary table for table data seeding # Create temporary table for table data seeding
insert_table = sql.table( insert_table = sql.table(
u'l7rule_type', 'l7rule_type',
sql.column(u'name', sa.String), sql.column('name', sa.String),
sql.column(u'description', sa.String) sql.column('description', sa.String)
) )
op.bulk_insert( op.bulk_insert(
@ -57,15 +57,15 @@ def upgrade():
# L7 Rule Compare Types # L7 Rule Compare Types
op.create_table( op.create_table(
u'l7rule_compare_type', 'l7rule_compare_type',
sa.Column(u'name', sa.String(36), primary_key=True), sa.Column('name', sa.String(36), primary_key=True),
sa.Column(u'description', sa.String(255), nullable=True) sa.Column('description', sa.String(255), nullable=True)
) )
insert_table = sql.table( insert_table = sql.table(
u'l7rule_compare_type', 'l7rule_compare_type',
sql.column(u'name', sa.String), sql.column('name', sa.String),
sql.column(u'description', sa.String) sql.column('description', sa.String)
) )
op.bulk_insert( op.bulk_insert(
@ -81,15 +81,15 @@ def upgrade():
# L7 Policy Actions # L7 Policy Actions
op.create_table( op.create_table(
u'l7policy_action', 'l7policy_action',
sa.Column(u'name', sa.String(36), primary_key=True), sa.Column('name', sa.String(36), primary_key=True),
sa.Column(u'description', sa.String(255), nullable=True) sa.Column('description', sa.String(255), nullable=True)
) )
insert_table = sql.table( insert_table = sql.table(
u'l7policy_action', 'l7policy_action',
sql.column(u'name', sa.String), sql.column('name', sa.String),
sql.column(u'description', sa.String) sql.column('description', sa.String)
) )
op.bulk_insert( op.bulk_insert(
@ -103,47 +103,47 @@ def upgrade():
# L7 Policies # L7 Policies
op.create_table( op.create_table(
u'l7policy', 'l7policy',
sa.Column(u'id', sa.String(36), nullable=False), sa.Column('id', sa.String(36), nullable=False),
sa.Column(u'name', sa.String(255), nullable=True), sa.Column('name', sa.String(255), nullable=True),
sa.Column(u'description', sa.String(255), nullable=True), sa.Column('description', sa.String(255), nullable=True),
sa.Column(u'listener_id', sa.String(36), nullable=False), sa.Column('listener_id', sa.String(36), nullable=False),
sa.Column(u'action', sa.String(36), nullable=False), sa.Column('action', sa.String(36), nullable=False),
sa.Column(u'redirect_pool_id', sa.String(36), nullable=True), sa.Column('redirect_pool_id', sa.String(36), nullable=True),
sa.Column(u'redirect_url', sa.String(255), nullable=True), sa.Column('redirect_url', sa.String(255), nullable=True),
sa.Column(u'position', sa.Integer, nullable=False), sa.Column('position', sa.Integer, nullable=False),
sa.Column(u'enabled', sa.Boolean(), default=True, nullable=False), sa.Column('enabled', sa.Boolean(), default=True, nullable=False),
sa.PrimaryKeyConstraint(u'id'), sa.PrimaryKeyConstraint('id'),
sa.ForeignKeyConstraint([u'listener_id'], sa.ForeignKeyConstraint(['listener_id'],
[u'listener.id'], ['listener.id'],
name=u'fk_l7policy_listener_id'), name='fk_l7policy_listener_id'),
sa.ForeignKeyConstraint([u'redirect_pool_id'], sa.ForeignKeyConstraint(['redirect_pool_id'],
[u'pool.id'], ['pool.id'],
name=u'fk_l7policy_pool_id'), name='fk_l7policy_pool_id'),
sa.ForeignKeyConstraint([u'action'], sa.ForeignKeyConstraint(['action'],
[u'l7policy_action.name'], ['l7policy_action.name'],
name=u'fk_l7policy_l7policy_action_name') name='fk_l7policy_l7policy_action_name')
) )
# L7 Rules # L7 Rules
op.create_table( op.create_table(
u'l7rule', 'l7rule',
sa.Column(u'id', sa.String(36), nullable=False), sa.Column('id', sa.String(36), nullable=False),
sa.Column(u'l7policy_id', sa.String(36), nullable=False), sa.Column('l7policy_id', sa.String(36), nullable=False),
sa.Column(u'type', sa.String(36), nullable=False), sa.Column('type', sa.String(36), nullable=False),
sa.Column(u'compare_type', sa.String(36), nullable=False), sa.Column('compare_type', sa.String(36), nullable=False),
sa.Column(u'key', sa.String(255), nullable=True), sa.Column('key', sa.String(255), nullable=True),
sa.Column(u'value', sa.String(255), nullable=False), sa.Column('value', sa.String(255), nullable=False),
sa.Column(u'invert', sa.Boolean(), default=False, nullable=False), sa.Column('invert', sa.Boolean(), default=False, nullable=False),
sa.PrimaryKeyConstraint(u'id'), sa.PrimaryKeyConstraint('id'),
sa.ForeignKeyConstraint([u'l7policy_id'], sa.ForeignKeyConstraint(['l7policy_id'],
[u'l7policy.id'], ['l7policy.id'],
name=u'fk_l7rule_l7policy_id'), name='fk_l7rule_l7policy_id'),
sa.ForeignKeyConstraint([u'type'], sa.ForeignKeyConstraint(['type'],
[u'l7rule_type.name'], ['l7rule_type.name'],
name=u'fk_l7rule_l7rule_type_name'), name='fk_l7rule_l7rule_type_name'),
sa.ForeignKeyConstraint([u'compare_type'], sa.ForeignKeyConstraint(['compare_type'],
[u'l7rule_compare_type.name'], ['l7rule_compare_type.name'],
name=u'fk_l7rule_l7rule_compare_type_name') name='fk_l7rule_l7rule_compare_type_name')
) )

View File

@ -34,8 +34,8 @@ down_revision = '6ffc710674ef'
def upgrade(): def upgrade():
# Create temporary table for table data seeding # Create temporary table for table data seeding
insert_table = sa.table( insert_table = sa.table(
u'spares_pool', 'spares_pool',
sa.column(u'updated_at', sa.DateTime), sa.column('updated_at', sa.DateTime),
) )
# Note: The date/time doesn't matter, we just need to seed the table. # Note: The date/time doesn't matter, we just need to seed the table.

View File

@ -32,9 +32,9 @@ down_revision = '3e5b37a0bdb9'
def upgrade(): def upgrade():
insert_table = sql.table( insert_table = sql.table(
u'provisioning_status', 'provisioning_status',
sql.column(u'name', sa.String), sql.column('name', sa.String),
sql.column(u'description', sa.String) sql.column('description', sa.String)
) )
op.bulk_insert( op.bulk_insert(

View File

@ -30,18 +30,18 @@ down_revision = '35dee79d5865'
def upgrade(): def upgrade():
op.add_column( op.add_column(
u'amphora', 'amphora',
sa.Column(u'load_balancer_id', sa.String(36), sa.Column('load_balancer_id', sa.String(36),
sa.ForeignKey(u'load_balancer.id', sa.ForeignKey('load_balancer.id',
name=u'fk_amphora_load_balancer_id'), name='fk_amphora_load_balancer_id'),
nullable=True) nullable=True)
) )
op.drop_table(u'load_balancer_amphora') op.drop_table('load_balancer_amphora')
op.drop_constraint( op.drop_constraint(
u'fk_container_provisioning_status_name', u'amphora', 'fk_container_provisioning_status_name', 'amphora',
type_=u'foreignkey' type_='foreignkey'
) )
op.create_foreign_key( op.create_foreign_key(
u'fk_amphora_provisioning_status_name', u'amphora', 'fk_amphora_provisioning_status_name', 'amphora',
u'provisioning_status', [u'status'], [u'name'] 'provisioning_status', ['status'], ['name']
) )

View File

@ -31,6 +31,6 @@ down_revision = '80dba23a159f'
def upgrade(): def upgrade():
op.add_column( op.add_column(
u'amphora', 'amphora',
sa.Column(u'compute_flavor', sa.String(255), nullable=True) sa.Column('compute_flavor', sa.String(255), nullable=True)
) )

View File

@ -29,5 +29,5 @@ down_revision = '13500e2e978d'
def upgrade(): def upgrade():
op.alter_column(u'member', u'address', new_column_name=u'ip_address', op.alter_column('member', 'address', new_column_name='ip_address',
existing_type=sa.String(64)) existing_type=sa.String(64))

View File

@ -28,6 +28,6 @@ down_revision = '48660b6643f0'
def upgrade(): def upgrade():
with op.batch_alter_table(u'vip') as batch_op: with op.batch_alter_table('vip') as batch_op:
batch_op.alter_column(u'network_id', new_column_name=u'subnet_id', batch_op.alter_column('network_id', new_column_name='subnet_id',
existing_type=sa.String(36)) existing_type=sa.String(36))

View File

@ -32,24 +32,24 @@ down_revision = 'd85ca7258d21'
def upgrade(): def upgrade():
op.add_column( op.add_column(
u'health_monitor', 'health_monitor',
sa.Column(u'created_at', sa.DateTime(), nullable=True) sa.Column('created_at', sa.DateTime(), nullable=True)
) )
op.add_column( op.add_column(
u'health_monitor', 'health_monitor',
sa.Column(u'updated_at', sa.DateTime(), nullable=True) sa.Column('updated_at', sa.DateTime(), nullable=True)
) )
op.add_column(u'health_monitor', op.add_column('health_monitor',
sa.Column(u'operating_status', sa.Column('operating_status',
sa.String(16), sa.String(16),
nullable=False, nullable=False,
server_default=constants.ONLINE) server_default=constants.ONLINE)
) )
op.alter_column(u'health_monitor', u'operating_status', op.alter_column('health_monitor', 'operating_status',
existing_type=sa.String(16), server_default=None) existing_type=sa.String(16), server_default=None)
op.create_foreign_key( op.create_foreign_key(
u'fk_health_monitor_operating_status_name', u'health_monitor', 'fk_health_monitor_operating_status_name', 'health_monitor',
u'operating_status', [u'operating_status'], [u'name'] 'operating_status', ['operating_status'], ['name']
) )

View File

@ -33,9 +33,9 @@ new_protocol = 'PROXY'
def upgrade(): def upgrade():
insert_table = sql.table( insert_table = sql.table(
u'protocol', 'protocol',
sql.column(u'name', sa.String), sql.column('name', sa.String),
sql.column(u'description', sa.String) sql.column('description', sa.String)
) )
op.bulk_insert( op.bulk_insert(

View File

@ -28,5 +28,5 @@ down_revision = '2351ea316465'
def upgrade(): def upgrade():
op.add_column(u'amphora_health', op.add_column('amphora_health',
sa.Column(u'busy', sa.Boolean(), nullable=False)) sa.Column('busy', sa.Boolean(), nullable=False))

View File

@ -32,13 +32,13 @@ down_revision = '76aacf2e176c'
def upgrade(): def upgrade():
# Add column redirect_prefix # Add column redirect_prefix
op.add_column( op.add_column(
u'l7policy', 'l7policy',
sa.Column(u'redirect_prefix', sa.String(255), nullable=True) sa.Column('redirect_prefix', sa.String(255), nullable=True)
) )
insert_table = sql.table( insert_table = sql.table(
u'l7policy_action', 'l7policy_action',
sql.column(u'name', sa.String), sql.column('name', sa.String),
sql.column(u'description', sa.String) sql.column('description', sa.String)
) )
op.bulk_insert( op.bulk_insert(

View File

@ -28,10 +28,10 @@ down_revision = '3b199c848b96'
def upgrade(): def upgrade():
op.add_column(u'amphora', op.add_column('amphora',
sa.Column(u'cert_expiration', sa.DateTime(timezone=True), sa.Column('cert_expiration', sa.DateTime(timezone=True),
nullable=True) nullable=True)
) )
op.add_column(u'amphora', sa.Column(u'cert_busy', sa.Boolean(), op.add_column('amphora', sa.Column('cert_busy', sa.Boolean(),
nullable=False, default=False)) nullable=False, default=False))

View File

@ -29,5 +29,5 @@ down_revision = '36b94648fef8'
def upgrade(): def upgrade():
op.alter_column(u'sni', u'tls_container_id', type_=sa.String(128), op.alter_column('sni', 'tls_container_id', type_=sa.String(128),
existing_type=sa.String(36), nullable=False) existing_type=sa.String(36), nullable=False)

View File

@ -31,6 +31,6 @@ down_revision = 'a7f187cd221f'
def upgrade(): def upgrade():
# Add column redirect_prefix # Add column redirect_prefix
op.add_column( op.add_column(
u'l7policy', 'l7policy',
sa.Column(u'redirect_http_code', sa.Integer(), nullable=True) sa.Column('redirect_http_code', sa.Integer(), nullable=True)
) )

View File

@ -32,9 +32,9 @@ new_protocol = 'PROMETHEUS'
def upgrade(): def upgrade():
insert_table = sql.table( insert_table = sql.table(
u'protocol', 'protocol',
sql.column(u'name', sa.String), sql.column('name', sa.String),
sql.column(u'description', sa.String) sql.column('description', sa.String)
) )
op.bulk_insert( op.bulk_insert(

View File

@ -30,6 +30,6 @@ down_revision = '7432f1d4ea83'
def upgrade(): def upgrade():
op.create_table( op.create_table(
u'spares_pool', 'spares_pool',
sa.Column(u'updated_at', sa.DateTime(), primary_key=True, sa.Column('updated_at', sa.DateTime(), primary_key=True,
server_default=sa.func.current_timestamp())) server_default=sa.func.current_timestamp()))

View File

@ -30,10 +30,10 @@ down_revision = '6742ca1b27c2'
def upgrade(): def upgrade():
op.add_column( op.add_column(
u'health_monitor', 'health_monitor',
sa.Column(u'http_version', sa.Float(), nullable=True) sa.Column('http_version', sa.Float(), nullable=True)
) )
op.add_column( op.add_column(
u'health_monitor', 'health_monitor',
sa.Column(u'domain_name', sa.String(255), nullable=True) sa.Column('domain_name', sa.String(255), nullable=True)
) )

View File

@ -30,7 +30,7 @@ down_revision = 'a1f689aecc1d'
def upgrade(): def upgrade():
op.add_column(u'pool', sa.Column(u'ca_tls_certificate_id', sa.String(255), op.add_column('pool', sa.Column('ca_tls_certificate_id', sa.String(255),
nullable=True)) nullable=True))
op.add_column(u'pool', sa.Column(u'crl_container_id', sa.String(255), op.add_column('pool', sa.Column('crl_container_id', sa.String(255),
nullable=True)) nullable=True))

View File

@ -30,7 +30,7 @@ from sqlalchemy import sql
revision = '76aacf2e176c' revision = '76aacf2e176c'
down_revision = 'ebbcc72b4e5e' down_revision = 'ebbcc72b4e5e'
tables = [u'protocol', u'health_monitor_type'] tables = ['protocol', 'health_monitor_type']
new_fields = ['UDP', 'UDP-CONNECT'] new_fields = ['UDP', 'UDP-CONNECT']
@ -40,8 +40,8 @@ def upgrade():
for table, new_field in zip(tables, new_fields): for table, new_field in zip(tables, new_fields):
insert_table = sql.table( insert_table = sql.table(
table, table,
sql.column(u'name', sa.String), sql.column('name', sa.String),
sql.column(u'description', sa.String) sql.column('description', sa.String)
) )
op.bulk_insert( op.bulk_insert(

View File

@ -29,9 +29,9 @@ down_revision = '55874a4ceed6'
def upgrade(): def upgrade():
op.create_table( op.create_table(
u'tags', 'tags',
sa.Column(u'resource_id', sa.String(36), primary_key=True, sa.Column('resource_id', sa.String(36), primary_key=True,
nullable=False), nullable=False),
sa.Column(u'tag', sa.String(255), primary_key=True, nullable=False, sa.Column('tag', sa.String(255), primary_key=True, nullable=False,
index=True), index=True),
) )

View File

@ -29,5 +29,5 @@ down_revision = '4a6ec0ab7284'
def upgrade(): def upgrade():
op.alter_column(u'vip', u'ip_address', op.alter_column('vip', 'ip_address',
existing_type=sa.String(64)) existing_type=sa.String(64))

View File

@ -29,13 +29,13 @@ down_revision = 'c761c8a71579'
def upgrade(): def upgrade():
op.add_column(u'load_balancer', op.add_column('load_balancer',
sa.Column(u'availability_zone', sa.Column('availability_zone',
sa.String(255), sa.String(255),
nullable=True) nullable=True)
) )
op.create_foreign_key( op.create_foreign_key(
u'fk_load_balancer_availability_zone_name', u'load_balancer', 'fk_load_balancer_availability_zone_name', 'load_balancer',
u'availability_zone', [u'availability_zone'], [u'name'] 'availability_zone', ['availability_zone'], ['name']
) )

View File

@ -34,8 +34,8 @@ def upgrade():
for table in ['protocol', 'health_monitor_type']: for table in ['protocol', 'health_monitor_type']:
insert_table = sql.table( insert_table = sql.table(
table, table,
sql.column(u'name', sa.String), sql.column('name', sa.String),
sql.column(u'description', sa.String) sql.column('description', sa.String)
) )
op.bulk_insert( op.bulk_insert(

View File

@ -29,5 +29,5 @@ down_revision = '186509101b9b'
def upgrade(): def upgrade():
op.alter_column(u'sni', u'tls_container_id', type_=sa.String(128), op.alter_column('sni', 'tls_container_id', type_=sa.String(128),
existing_type=sa.String(36), nullable=False) existing_type=sa.String(36), nullable=False)

View File

@ -29,10 +29,10 @@ down_revision = '256852d5ff7c'
def upgrade(): def upgrade():
op.create_table( op.create_table(
u'amphora_health', 'amphora_health',
sa.Column(u'amphora_id', sa.String(36), nullable=False, sa.Column('amphora_id', sa.String(36), nullable=False,
primary_key=True), primary_key=True),
sa.Column(u'last_update', sa.DateTime(timezone=True), sa.Column('last_update', sa.DateTime(timezone=True),
nullable=False) nullable=False)
) )

View File

@ -36,8 +36,8 @@ def upgrade():
nullable=True) nullable=True)
) )
op.create_foreign_key( op.create_foreign_key(
u'fk_health_monitor_provisioning_status_name', u'health_monitor', 'fk_health_monitor_provisioning_status_name', 'health_monitor',
u'provisioning_status', [u'provisioning_status'], [u'name'] 'provisioning_status', ['provisioning_status'], ['name']
) )
op.add_column('l7policy', op.add_column('l7policy',
@ -46,8 +46,8 @@ def upgrade():
nullable=True) nullable=True)
) )
op.create_foreign_key( op.create_foreign_key(
u'fk_l7policy_provisioning_status_name', u'l7policy', 'fk_l7policy_provisioning_status_name', 'l7policy',
u'provisioning_status', [u'provisioning_status'], [u'name'] 'provisioning_status', ['provisioning_status'], ['name']
) )
op.add_column('l7rule', op.add_column('l7rule',
@ -56,8 +56,8 @@ def upgrade():
nullable=True) nullable=True)
) )
op.create_foreign_key( op.create_foreign_key(
u'fk_l7rule_provisioning_status_name', u'l7rule', 'fk_l7rule_provisioning_status_name', 'l7rule',
u'provisioning_status', [u'provisioning_status'], [u'name'] 'provisioning_status', ['provisioning_status'], ['name']
) )
op.add_column('member', op.add_column('member',
@ -66,8 +66,8 @@ def upgrade():
nullable=True) nullable=True)
) )
op.create_foreign_key( op.create_foreign_key(
u'fk_member_provisioning_status_name', u'member', 'fk_member_provisioning_status_name', 'member',
u'provisioning_status', [u'provisioning_status'], [u'name'] 'provisioning_status', ['provisioning_status'], ['name']
) )
op.add_column('pool', op.add_column('pool',
@ -76,6 +76,6 @@ def upgrade():
nullable=True) nullable=True)
) )
op.create_foreign_key( op.create_foreign_key(
u'fk_pool_provisioning_status_name', u'pool', 'fk_pool_provisioning_status_name', 'pool',
u'provisioning_status', [u'provisioning_status'], [u'name'] 'provisioning_status', ['provisioning_status'], ['name']
) )

View File

@ -31,5 +31,5 @@ down_revision = '1afc932f1ca2'
def upgrade(): def upgrade():
op.add_column(u'pool', sa.Column(u'tls_certificate_id', sa.String(255), op.add_column('pool', sa.Column('tls_certificate_id', sa.String(255),
nullable=True)) nullable=True))

View File

@ -31,7 +31,7 @@ down_revision = '74aae261694c'
def upgrade(): def upgrade():
op.add_column(u'pool', op.add_column('pool',
sa.Column(u'tls_enabled', sa.Boolean(), sa.Column('tls_enabled', sa.Boolean(),
server_default=sa.sql.expression.false(), server_default=sa.sql.expression.false(),
nullable=False)) nullable=False))

View File

@ -31,23 +31,23 @@ down_revision = '4f65b4f91c39'
def upgrade(): def upgrade():
op.create_table( op.create_table(
u'flavor_profile', 'flavor_profile',
sa.Column(u'id', sa.String(36), nullable=False), sa.Column('id', sa.String(36), nullable=False),
sa.Column(u'name', sa.String(255), nullable=False), sa.Column('name', sa.String(255), nullable=False),
sa.Column(u'provider_name', sa.String(255), nullable=False), sa.Column('provider_name', sa.String(255), nullable=False),
sa.Column(u'flavor_data', sa.String(4096), nullable=False), sa.Column('flavor_data', sa.String(4096), nullable=False),
sa.PrimaryKeyConstraint(u'id')) sa.PrimaryKeyConstraint('id'))
op.create_table( op.create_table(
u'flavor', 'flavor',
sa.Column(u'id', sa.String(36), nullable=False), sa.Column('id', sa.String(36), nullable=False),
sa.Column(u'name', sa.String(255), nullable=False), sa.Column('name', sa.String(255), nullable=False),
sa.Column(u'description', sa.String(255), nullable=True), sa.Column('description', sa.String(255), nullable=True),
sa.Column(u'enabled', sa.Boolean(), nullable=False), sa.Column('enabled', sa.Boolean(), nullable=False),
sa.Column(u'flavor_profile_id', sa.String(36), nullable=False), sa.Column('flavor_profile_id', sa.String(36), nullable=False),
sa.ForeignKeyConstraint([u'flavor_profile_id'], sa.ForeignKeyConstraint(['flavor_profile_id'],
[u'flavor_profile.id'], ['flavor_profile.id'],
name=u'fk_flavor_flavor_profile_id'), name='fk_flavor_flavor_profile_id'),
sa.PrimaryKeyConstraint(u'id'), sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint(u'name', sa.UniqueConstraint('name',
name=u'uq_flavor_name'),) name='uq_flavor_name'),)

View File

@ -30,5 +30,5 @@ down_revision = '034756a182a2'
def upgrade(): def upgrade():
op.add_column(u'member', sa.Column(u'backup', sa.Boolean(), op.add_column('member', sa.Column('backup', sa.Boolean(),
nullable=False, default=False)) nullable=False, default=False))

View File

@ -29,5 +29,5 @@ down_revision = '4aeb9e23ad43'
def upgrade(): def upgrade():
op.add_column(u'amphora', sa.Column(u'cached_zone', sa.String(255), op.add_column('amphora', sa.Column('cached_zone', sa.String(255),
nullable=True)) nullable=True))

View File

@ -32,12 +32,12 @@ down_revision = 'e37941b010db'
def upgrade(): def upgrade():
azp_table = op.create_table( azp_table = op.create_table(
u'availability_zone_profile', 'availability_zone_profile',
sa.Column(u'id', sa.String(36), nullable=False), sa.Column('id', sa.String(36), nullable=False),
sa.Column(u'name', sa.String(255), nullable=False), sa.Column('name', sa.String(255), nullable=False),
sa.Column(u'provider_name', sa.String(255), nullable=False), sa.Column('provider_name', sa.String(255), nullable=False),
sa.Column(u'availability_zone_data', sa.String(4096), nullable=False), sa.Column('availability_zone_data', sa.String(4096), nullable=False),
sa.PrimaryKeyConstraint(u'id')) sa.PrimaryKeyConstraint('id'))
op.bulk_insert( op.bulk_insert(
azp_table, azp_table,
@ -48,16 +48,16 @@ def upgrade():
) )
az_table = op.create_table( az_table = op.create_table(
u'availability_zone', 'availability_zone',
sa.Column(u'name', sa.String(255), nullable=False), sa.Column('name', sa.String(255), nullable=False),
sa.Column(u'description', sa.String(255), nullable=True), sa.Column('description', sa.String(255), nullable=True),
sa.Column(u'enabled', sa.Boolean(), nullable=False), sa.Column('enabled', sa.Boolean(), nullable=False),
sa.Column(u'availability_zone_profile_id', sa.String(36), sa.Column('availability_zone_profile_id', sa.String(36),
nullable=False), nullable=False),
sa.ForeignKeyConstraint([u'availability_zone_profile_id'], sa.ForeignKeyConstraint(['availability_zone_profile_id'],
[u'availability_zone_profile.id'], ['availability_zone_profile.id'],
name=u'fk_az_az_profile_id'), name='fk_az_az_profile_id'),
sa.PrimaryKeyConstraint(u'name'),) sa.PrimaryKeyConstraint('name'),)
op.bulk_insert( op.bulk_insert(
az_table, az_table,

View File

@ -33,39 +33,39 @@ down_revision = '034b2dc2f3e0'
def upgrade(): def upgrade():
# Add timing data # Add timing data
op.add_column( op.add_column(
u'l7rule', 'l7rule',
sa.Column(u'created_at', sa.DateTime(), nullable=True) sa.Column('created_at', sa.DateTime(), nullable=True)
) )
op.add_column( op.add_column(
u'l7rule', 'l7rule',
sa.Column(u'updated_at', sa.DateTime(), nullable=True) sa.Column('updated_at', sa.DateTime(), nullable=True)
) )
# Add project_id # Add project_id
op.add_column( op.add_column(
u'l7rule', 'l7rule',
sa.Column(u'project_id', sa.String(36), nullable=True) sa.Column('project_id', sa.String(36), nullable=True)
) )
# Add enabled # Add enabled
op.add_column( op.add_column(
u'l7rule', 'l7rule',
sa.Column(u'enabled', sa.Boolean(), sa.Column('enabled', sa.Boolean(),
server_default=sa.sql.expression.true(), server_default=sa.sql.expression.true(),
nullable=False) nullable=False)
) )
# Add new operating_status column, setting existing rows to ONLINE # Add new operating_status column, setting existing rows to ONLINE
op.add_column( op.add_column(
u'l7rule', 'l7rule',
sa.Column(u'operating_status', sa.String(16), sa.Column('operating_status', sa.String(16),
nullable=False, server_default=constants.ONLINE) nullable=False, server_default=constants.ONLINE)
) )
# Remove the default, as we don't actually want one # Remove the default, as we don't actually want one
op.alter_column(u'l7rule', u'operating_status', op.alter_column('l7rule', 'operating_status',
existing_type=sa.String(16), server_default=None) existing_type=sa.String(16), server_default=None)
# Add the foreign key for operating_status_name # Add the foreign key for operating_status_name
op.create_foreign_key( op.create_foreign_key(
u'fk_l7rule_operating_status_name', u'l7rule', 'fk_l7rule_operating_status_name', 'l7rule',
u'operating_status', [u'operating_status'], [u'name'] 'operating_status', ['operating_status'], ['name']
) )

View File

@ -29,12 +29,12 @@ down_revision = 'a5762a99609a'
def upgrade(): def upgrade():
op.create_table( op.create_table(
u'listener_cidr', 'listener_cidr',
sa.Column(u'listener_id', sa.String(36), nullable=False), sa.Column('listener_id', sa.String(36), nullable=False),
sa.Column(u'cidr', sa.String(64), nullable=False), sa.Column('cidr', sa.String(64), nullable=False),
sa.ForeignKeyConstraint([u'listener_id'], sa.ForeignKeyConstraint(['listener_id'],
[u'listener.id'], ['listener.id'],
name=u'fk_listener_cidr_listener_id'), name='fk_listener_cidr_listener_id'),
sa.PrimaryKeyConstraint(u'listener_id', u'cidr') sa.PrimaryKeyConstraint('listener_id', 'cidr')
) )

View File

@ -55,8 +55,8 @@ def migrate_pools():
def upgrade(): def upgrade():
insert_table = sa.table( insert_table = sa.table(
u'algorithm', 'algorithm',
sa.column(u'name', sa.String(255)), sa.column('name', sa.String(255)),
) )
op.bulk_insert( op.bulk_insert(
insert_table, insert_table,

View File

@ -32,11 +32,11 @@ down_revision = 'dcf88e59aae4'
def upgrade(): def upgrade():
insert_table = sql.table( insert_table = sql.table(
u'flavor_profile', 'flavor_profile',
sa.Column(u'id', sa.String(36), nullable=False), sa.Column('id', sa.String(36), nullable=False),
sa.Column(u'name', sa.String(255), nullable=False), sa.Column('name', sa.String(255), nullable=False),
sa.Column(u'provider_name', sa.String(255), nullable=False), sa.Column('provider_name', sa.String(255), nullable=False),
sa.Column(u'flavor_data', sa.String(4096), nullable=False), sa.Column('flavor_data', sa.String(4096), nullable=False),
) )
op.bulk_insert( op.bulk_insert(
@ -48,12 +48,12 @@ def upgrade():
) )
insert_table = sql.table( insert_table = sql.table(
u'flavor', 'flavor',
sa.Column(u'id', sa.String(36), nullable=False), sa.Column('id', sa.String(36), nullable=False),
sa.Column(u'name', sa.String(255), nullable=False), sa.Column('name', sa.String(255), nullable=False),
sa.Column(u'description', sa.String(255), nullable=True), sa.Column('description', sa.String(255), nullable=True),
sa.Column(u'enabled', sa.Boolean(), nullable=False), sa.Column('enabled', sa.Boolean(), nullable=False),
sa.Column(u'flavor_profile_id', sa.String(36), nullable=False), sa.Column('flavor_profile_id', sa.String(36), nullable=False),
) )
op.bulk_insert( op.bulk_insert(

View File

@ -31,9 +31,9 @@ down_revision = '27e54d00c3cd'
def upgrade(): def upgrade():
insert_table = sql.table( insert_table = sql.table(
u'health_monitor_type', 'health_monitor_type',
sql.column(u'name', sa.String), sql.column('name', sa.String),
sql.column(u'description', sa.String) sql.column('description', sa.String)
) )
op.bulk_insert( op.bulk_insert(

View File

@ -30,9 +30,9 @@ down_revision = '2ab994dd3ec2'
def upgrade(): def upgrade():
insert_table = sql.table( insert_table = sql.table(
u'protocol', 'protocol',
sql.column(u'name', sa.String), sql.column('name', sa.String),
sql.column(u'description', sa.String) sql.column('description', sa.String)
) )
op.bulk_insert( op.bulk_insert(

View File

@ -29,6 +29,6 @@ down_revision = '0f242cf02c74'
def upgrade(): def upgrade():
op.add_column( op.add_column(
u'vip', 'vip',
sa.Column(u'octavia_owned', sa.Boolean(), nullable=True) sa.Column('octavia_owned', sa.Boolean(), nullable=True)
) )

View File

@ -34,14 +34,14 @@ down_revision = '2ad093f6353f'
def upgrade(): def upgrade():
op.create_table( op.create_table(
u'client_authentication_mode', 'client_authentication_mode',
sa.Column(u'name', sa.String(10), primary_key=True), sa.Column('name', sa.String(10), primary_key=True),
) )
# Create temporary table for table data seeding # Create temporary table for table data seeding
insert_table = sa.table( insert_table = sa.table(
u'client_authentication_mode', 'client_authentication_mode',
sa.column(u'name', sa.String), sa.column('name', sa.String),
) )
op.bulk_insert( op.bulk_insert(
@ -54,8 +54,8 @@ def upgrade():
) )
op.add_column( op.add_column(
u'listener', 'listener',
sa.Column(u'client_authentication', sa.String(10), sa.Column('client_authentication', sa.String(10),
sa.ForeignKey('client_authentication_mode.name'), sa.ForeignKey('client_authentication_mode.name'),
server_default=constants.CLIENT_AUTH_NONE, nullable=False) server_default=constants.CLIENT_AUTH_NONE, nullable=False)
) )

View File

@ -31,16 +31,16 @@ down_revision = '443fe6676637'
def upgrade(): def upgrade():
op.create_table( op.create_table(
u'amphora_build_slots', 'amphora_build_slots',
sa.Column(u'id', sa.Integer(), primary_key=True), sa.Column('id', sa.Integer(), primary_key=True),
sa.Column(u'slots_used', sa.Integer(), default=0) sa.Column('slots_used', sa.Integer(), default=0)
) )
# Create temporary table for table data seeding # Create temporary table for table data seeding
insert_table = sql.table( insert_table = sql.table(
u'amphora_build_slots', 'amphora_build_slots',
sql.column(u'id', sa.Integer), sql.column('id', sa.Integer),
sql.column(u'slots_used', sa.Integer) sql.column('slots_used', sa.Integer)
) )
op.bulk_insert( op.bulk_insert(
@ -51,12 +51,12 @@ def upgrade():
) )
op.create_table( op.create_table(
u'amphora_build_request', 'amphora_build_request',
sa.Column(u'amphora_id', sa.String(36), nullable=True, sa.Column('amphora_id', sa.String(36), nullable=True,
primary_key=True), primary_key=True),
sa.Column(u'priority', sa.Integer()), sa.Column('priority', sa.Integer()),
sa.Column(u'created_time', sa.DateTime(timezone=True), nullable=False), sa.Column('created_time', sa.DateTime(timezone=True), nullable=False),
sa.Column(u'status', sa.String(16), default='WAITING', nullable=False) sa.Column('status', sa.String(16), default='WAITING', nullable=False)
) )

View File

@ -31,6 +31,6 @@ down_revision = 'f21ae3f21adc'
def upgrade(): def upgrade():
op.add_column(u'listener', op.add_column('listener',
sa.Column(u'client_crl_container_id', sa.String(255), sa.Column('client_crl_container_id', sa.String(255),
nullable=True)) nullable=True))

View File

@ -185,7 +185,7 @@ class ListenerStatistics(base_models.BASE):
self.total_connections += other.total_connections self.total_connections += other.total_connections
else: else:
raise TypeError( # noqa: O342 raise TypeError( # noqa: O342
"unsupported operand type(s) for +=: '{0}' and '{1}'".format( "unsupported operand type(s) for +=: '{}' and '{}'".format(
type(self), type(other))) type(self), type(other)))
return self return self

View File

@ -49,7 +49,7 @@ CONF = cfg.CONF
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
class BaseRepository(object): class BaseRepository:
model_class = None model_class = None
def count(self, session, **filters): def count(self, session, **filters):
@ -209,7 +209,7 @@ class BaseRepository(object):
return id_list return id_list
class Repositories(object): class Repositories:
def __init__(self): def __init__(self):
self.load_balancer = LoadBalancerRepository() self.load_balancer = LoadBalancerRepository()
self.vip = VipRepository() self.vip = VipRepository()
@ -1943,7 +1943,7 @@ class QuotasRepository(BaseRepository):
session.flush() session.flush()
class _GetALLExceptDELETEDIdMixin(object): class _GetALLExceptDELETEDIdMixin:
def get_all(self, session, pagination_helper=None, def get_all(self, session, pagination_helper=None,
query_options=None, **filters): query_options=None, **filters):