6033N/AIn-house patch to skip over unnecessary database migrations for Neutron.
6033N/AJuno database tables for Neutron do not need these migrations when upgrading
6033N/Ato Kilo.
6033N/A
6033N/A--- neutron-2015.1.2/neutron/db/migration/alembic_migrations/agent_init_ops.py.orig 2016-04-22 23:23:15.523526779 -0700
6033N/A+++ neutron-2015.1.2/neutron/db/migration/alembic_migrations/agent_init_ops.py 2016-04-22 23:25:39.337181119 -0700
6033N/A@@ -23,7 +23,10 @@
6033N/A
6033N/A
6033N/A def upgrade():
6033N/A- op.create_table(
6033N/A+ bind = op.get_bind()
6033N/A+ insp = sa.engine.reflection.Inspector.from_engine(bind)
6033N/A+ if 'agents' not in insp.get_table_names():
6033N/A+ op.create_table(
6033N/A 'agents',
6033N/A sa.Column('id', sa.String(length=36), nullable=False),
6033N/A sa.Column('agent_type', sa.String(length=255), nullable=False),
6033N/A--- neutron-2015.1.2/neutron/db/migration/alembic_migrations/core_init_ops.py.orig 2016-04-22 23:25:50.350653015 -0700
6033N/A+++ neutron-2015.1.2/neutron/db/migration/alembic_migrations/core_init_ops.py 2016-04-22 23:30:15.715403373 -0700
6033N/A@@ -19,7 +19,11 @@
6033N/A
6033N/A
6033N/A def upgrade():
6033N/A- op.create_table(
6033N/A+ bind = op.get_bind()
6033N/A+ insp = sa.engine.reflection.Inspector.from_engine(bind)
6033N/A+ table_names = insp.get_table_names()
6033N/A+ if 'networks' not in table_names:
6033N/A+ op.create_table(
6033N/A 'networks',
6033N/A sa.Column('tenant_id', sa.String(length=255), nullable=True),
6033N/A sa.Column('id', sa.String(length=36), nullable=False),
6033N/A@@ -29,7 +33,8 @@
6033N/A sa.Column('shared', sa.Boolean(), nullable=True),
6033N/A sa.PrimaryKeyConstraint('id'))
6033N/A
6033N/A- op.create_table(
6033N/A+ if 'ports' not in table_names:
6033N/A+ op.create_table(
6033N/A 'ports',
6033N/A sa.Column('tenant_id', sa.String(length=255), nullable=True),
6033N/A sa.Column('id', sa.String(length=36), nullable=False),
6033N/A@@ -43,7 +48,8 @@
6033N/A sa.ForeignKeyConstraint(['network_id'], ['networks.id'], ),
6033N/A sa.PrimaryKeyConstraint('id'))
6033N/A
6033N/A- op.create_table(
6033N/A+ if 'subnets' not in table_names:
6033N/A+ op.create_table(
6033N/A 'subnets',
6033N/A sa.Column('tenant_id', sa.String(length=255), nullable=True),
6033N/A sa.Column('id', sa.String(length=36), nullable=False),
6033N/A@@ -57,7 +63,8 @@
6033N/A sa.ForeignKeyConstraint(['network_id'], ['networks.id'], ),
6033N/A sa.PrimaryKeyConstraint('id'))
6033N/A
6033N/A- op.create_table(
6033N/A+ if 'dnsnameservers' not in table_names:
6033N/A+ op.create_table(
6033N/A 'dnsnameservers',
6033N/A sa.Column('address', sa.String(length=128), nullable=False),
6033N/A sa.Column('subnet_id', sa.String(length=36), nullable=False),
6033N/A@@ -65,7 +72,8 @@
6033N/A ondelete='CASCADE'),
6033N/A sa.PrimaryKeyConstraint('address', 'subnet_id'))
6033N/A
6033N/A- op.create_table(
6033N/A+ if 'ipallocationpools' not in table_names:
6033N/A+ op.create_table(
6033N/A 'ipallocationpools',
6033N/A sa.Column('id', sa.String(length=36), nullable=False),
6033N/A sa.Column('subnet_id', sa.String(length=36), nullable=True),
6033N/A@@ -75,7 +83,8 @@
6033N/A ondelete='CASCADE'),
6033N/A sa.PrimaryKeyConstraint('id'))
6033N/A
6033N/A- op.create_table(
6033N/A+ if 'subnetroutes' not in table_names:
6033N/A+ op.create_table(
6033N/A 'subnetroutes',
6033N/A sa.Column('destination', sa.String(length=64), nullable=False),
6033N/A sa.Column('nexthop', sa.String(length=64), nullable=False),
6033N/A@@ -84,7 +93,8 @@
6033N/A ondelete='CASCADE'),
6033N/A sa.PrimaryKeyConstraint('destination', 'nexthop', 'subnet_id'))
6033N/A
6033N/A- op.create_table(
6033N/A+ if 'ipallocations' not in table_names:
6033N/A+ op.create_table(
6033N/A 'ipallocations',
6033N/A sa.Column('port_id', sa.String(length=36), nullable=True),
6033N/A sa.Column('ip_address', sa.String(length=64), nullable=False),
6033N/A@@ -97,7 +107,8 @@
6033N/A ondelete='CASCADE'),
6033N/A sa.PrimaryKeyConstraint('ip_address', 'subnet_id', 'network_id'))
6033N/A
6033N/A- op.create_table(
6033N/A+ if 'ipavailabilityranges' not in table_names:
6033N/A+ op.create_table(
6033N/A 'ipavailabilityranges',
6033N/A sa.Column('allocation_pool_id', sa.String(length=36), nullable=False),
6033N/A sa.Column('first_ip', sa.String(length=64), nullable=False),
6033N/A@@ -106,7 +117,8 @@
6033N/A ['ipallocationpools.id'], ondelete='CASCADE'),
6033N/A sa.PrimaryKeyConstraint('allocation_pool_id', 'first_ip', 'last_ip'))
6033N/A
6033N/A- op.create_table(
6033N/A+ if 'networkdhcpagentbindings' not in table_names:
6033N/A+ op.create_table(
6033N/A 'networkdhcpagentbindings',
6033N/A sa.Column('network_id', sa.String(length=36), nullable=False),
6033N/A sa.Column('dhcp_agent_id', sa.String(length=36), nullable=False),
6033N/A--- neutron-2015.1.2/neutron/db/migration/alembic_migrations/l3_init_ops.py.orig 2016-04-22 23:35:15.205163303 -0700
6033N/A+++ neutron-2015.1.2/neutron/db/migration/alembic_migrations/l3_init_ops.py 2016-04-22 23:33:36.741262443 -0700
6033N/A@@ -31,14 +31,20 @@
6033N/A
6033N/A
6033N/A def upgrade():
6033N/A- op.create_table(
6033N/A+ bind = op.get_bind()
6033N/A+ insp = sa.engine.reflection.Inspector.from_engine(bind)
6033N/A+ table_names = insp.get_table_names()
6033N/A+
6033N/A+ if 'externalnetworks' not in table_names:
6033N/A+ op.create_table(
6033N/A 'externalnetworks',
6033N/A sa.Column('network_id', sa.String(length=36), nullable=False),
6033N/A sa.ForeignKeyConstraint(['network_id'], ['networks.id'],
6033N/A ondelete='CASCADE'),
6033N/A sa.PrimaryKeyConstraint('network_id'))
6033N/A
6033N/A- op.create_table(
6033N/A+ if 'routers' not in table_names:
6033N/A+ op.create_table(
6033N/A 'routers',
6033N/A sa.Column('tenant_id', sa.String(length=255), nullable=True),
6033N/A sa.Column('id', sa.String(length=36), nullable=False),
6033N/A@@ -51,7 +57,8 @@
6033N/A sa.ForeignKeyConstraint(['gw_port_id'], ['ports.id'], ),
6033N/A sa.PrimaryKeyConstraint('id'))
6033N/A
6033N/A- op.create_table(
6033N/A+ if 'floatingips' not in table_names:
6033N/A+ op.create_table(
6033N/A 'floatingips',
6033N/A sa.Column('tenant_id', sa.String(length=255), nullable=True),
6033N/A sa.Column('id', sa.String(length=36), nullable=False),
6033N/A--- neutron-2015.1.2/neutron/db/migration/alembic_migrations/other_extensions_init_ops.py.orig 2016-04-22 23:35:35.724592904 -0700
6033N/A+++ neutron-2015.1.2/neutron/db/migration/alembic_migrations/other_extensions_init_ops.py 2016-04-22 23:37:11.709485583 -0700
6033N/A@@ -34,7 +34,10 @@
6033N/A sa.PrimaryKeyConstraint('provider_name', 'resource_id'),
6033N/A sa.UniqueConstraint('resource_id'))
6033N/A
6033N/A- op.create_table(
6033N/A+ bind = op.get_bind()
6033N/A+ insp = sa.engine.reflection.Inspector.from_engine(bind)
6033N/A+ if 'quotas' not in insp.get_table_names():
6033N/A+ op.create_table(
6033N/A 'quotas',
6033N/A sa.Column('id', sa.String(length=36), nullable=False),
6033N/A sa.Column('tenant_id', sa.String(length=255), nullable=True),
6033N/A--- neutron-2015.1.2/neutron/db/migration/alembic_migrations/versions/1fcfc149aca4_agents_unique_by_type_and_host.py.orig 2016-04-23 01:59:50.554268246 -0700
6033N/A+++ neutron-2015.1.2/neutron/db/migration/alembic_migrations/versions/1fcfc149aca4_agents_unique_by_type_and_host.py 2016-04-23 02:01:10.767910540 -0700
6033N/A@@ -26,6 +26,7 @@
6033N/A down_revision = 'e197124d4b9'
6033N/A
6033N/A from alembic import op
6033N/A+import sqlalchemy as sa
6033N/A
6033N/A from neutron.db import migration
6033N/A
6033N/A@@ -41,7 +42,14 @@
6033N/A # configured plugin did not create the agents table.
6033N/A return
6033N/A
6033N/A- op.create_unique_constraint(
6033N/A+ bind = op.get_bind()
6033N/A+ insp = sa.engine.reflection.Inspector.from_engine(bind)
6033N/A+ u_cons_list = insp.get_unique_constraints(TABLE_NAME)
6033N/A+ u_cons = []
6033N/A+ for c in u_cons_list:
6033N/A+ u_cons.append(c['name'])
6033N/A+ if UC_NAME not in u_cons:
6033N/A+ op.create_unique_constraint(
6033N/A name=UC_NAME,
6033N/A source=TABLE_NAME,
6033N/A local_cols=['agent_type', 'host']
6033N/A--- neutron-2015.1.2/neutron/db/migration/alembic_migrations/versions/2eeaf963a447_floatingip_status.py.orig 2016-04-22 23:41:17.060181778 -0700
6033N/A+++ neutron-2015.1.2/neutron/db/migration/alembic_migrations/versions/2eeaf963a447_floatingip_status.py 2016-04-22 23:57:26.134124564 -0700
6033N/A@@ -38,11 +38,20 @@
6033N/A # did not create the floatingips table.
6033N/A return
6033N/A
6033N/A- op.add_column('floatingips',
6033N/A+ bind = op.get_bind()
6033N/A+ insp = sa.engine.reflection.Inspector.from_engine(bind)
6033N/A+ col_names_list = insp.get_columns('floatingips')
6033N/A+ col_names = []
6033N/A+ for c in col_names_list:
6033N/A+ col_names.append(c['name'])
6033N/A+
6033N/A+ if 'last_known_router_id' not in col_names:
6033N/A+ op.add_column('floatingips',
6033N/A sa.Column('last_known_router_id',
6033N/A sa.String(length=36),
6033N/A nullable=True))
6033N/A- op.add_column('floatingips',
6033N/A+ if 'status' not in col_names:
6033N/A+ op.add_column('floatingips',
6033N/A sa.Column('status',
6033N/A sa.String(length=16),
6033N/A nullable=True))
6033N/A--- neutron-2015.1.2/neutron/db/migration/alembic_migrations/versions/2447ad0e9585_add_ipv6_mode_props.py.orig 2016-04-22 23:42:16.956052992 -0700
6033N/A+++ neutron-2015.1.2/neutron/db/migration/alembic_migrations/versions/2447ad0e9585_add_ipv6_mode_props.py 2016-04-22 23:54:33.628120696 -0700
6033N/A@@ -37,7 +37,15 @@
6033N/A % ('slaac', 'dhcpv6-stateful', 'dhcpv6-stateless'))
6033N/A op.execute("CREATE TYPE ipv6_address_modes AS ENUM ('%s', '%s', '%s')"
6033N/A % ('slaac', 'dhcpv6-stateful', 'dhcpv6-stateless'))
6033N/A- op.add_column('subnets',
6033N/A+ bind = op.get_bind()
6033N/A+ insp = sa.engine.reflection.Inspector.from_engine(bind)
6033N/A+ col_names_list = insp.get_columns('subnets')
6033N/A+ col_names = []
6033N/A+ for c in col_names_list:
6033N/A+ col_names.append(c['name'])
6033N/A+
6033N/A+ if 'ipv6_ra_mode' not in col_names:
6033N/A+ op.add_column('subnets',
6033N/A sa.Column('ipv6_ra_mode',
6033N/A sa.Enum('slaac',
6033N/A 'dhcpv6-stateful',
6033N/A@@ -45,7 +53,8 @@
6033N/A name='ipv6_ra_modes'),
6033N/A nullable=True)
6033N/A )
6033N/A- op.add_column('subnets',
6033N/A+ if 'ipv6_address_mode' not in col_names:
6033N/A+ op.add_column('subnets',
6033N/A sa.Column('ipv6_address_mode',
6033N/A sa.Enum('slaac',
6033N/A 'dhcpv6-stateful',
6033N/A--- neutron-2015.1.2/neutron/db/migration/alembic_migrations/versions/544673ac99ab_add_router_port_table.py.orig 2016-04-22 23:43:11.770727387 -0700
6033N/A+++ neutron-2015.1.2/neutron/db/migration/alembic_migrations/versions/544673ac99ab_add_router_port_table.py 2016-04-22 23:45:53.016161819 -0700
6033N/A@@ -40,7 +40,10 @@
6033N/A
6033N/A
6033N/A def upgrade():
6033N/A- op.create_table(
6033N/A+ bind = op.get_bind()
6033N/A+ insp = sa.engine.reflection.Inspector.from_engine(bind)
6033N/A+ if 'routerports' not in insp.get_table_names():
6033N/A+ op.create_table(
6033N/A 'routerports',
6033N/A sa.Column('router_id', sa.String(length=36), nullable=False),
6033N/A sa.Column('port_id', sa.String(length=36), nullable=False),
6033N/A@@ -59,6 +59,6 @@
6033N/A ['ports.id'],
6033N/A ondelete='CASCADE'
6033N/A ),
6033N/A- )
6033N/A+ )
6033N/A
6033N/A- op.execute(SQL_STATEMENT)
6033N/A+ op.execute(SQL_STATEMENT)
6033N/A