Introduce havana initial state
This patch replaces folsom initial state and all migrations from folsom to havana, with a new, configuration independent initial db state, corresponding to the havana release. In order to avoid large modules, "init ops" modules have been created for all plugins, service plugins, and extensions. Some migrations after the havana release were amended or removed to reflect the new initial state being introduced. Partially-implements: blueprint reorganize-migrations Change-Id: I47bfd0d26fad1373013ae0d5716266ca40c493c6
This commit is contained in:
parent
94742426c1
commit
a141d57d89
43
neutron/db/migration/alembic_migrations/agent_init_ops.py
Normal file
43
neutron/db/migration/alembic_migrations/agent_init_ops.py
Normal file
@ -0,0 +1,43 @@
|
||||
# Copyright 2014 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
# Initial operations for agent management extension
|
||||
# This module only manages the 'agents' table. Binding tables are created
|
||||
# in the modules for relevant resources
|
||||
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
def upgrade():
|
||||
op.create_table(
|
||||
'agents',
|
||||
sa.Column('id', sa.String(length=36), nullable=False),
|
||||
sa.Column('agent_type', sa.String(length=255), nullable=False),
|
||||
sa.Column('binary', sa.String(length=255), nullable=False),
|
||||
sa.Column('topic', sa.String(length=255), nullable=False),
|
||||
sa.Column('host', sa.String(length=255), nullable=False),
|
||||
sa.Column('admin_state_up', sa.Boolean(), nullable=False),
|
||||
sa.Column('created_at', sa.DateTime(), nullable=False),
|
||||
sa.Column('started_at', sa.DateTime(), nullable=False),
|
||||
sa.Column('heartbeat_timestamp', sa.DateTime(), nullable=False),
|
||||
sa.Column('description', sa.String(length=255), nullable=True),
|
||||
sa.Column('configurations', sa.String(length=4095), nullable=False),
|
||||
sa.PrimaryKeyConstraint('id'))
|
||||
|
||||
|
||||
def downgrade():
|
||||
op.drop_table('agents')
|
43
neutron/db/migration/alembic_migrations/brocade_init_ops.py
Normal file
43
neutron/db/migration/alembic_migrations/brocade_init_ops.py
Normal file
@ -0,0 +1,43 @@
|
||||
# Copyright 2014 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
# Initial operations for the Mellanox plugin
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
def upgrade():
|
||||
op.create_table(
|
||||
'brocadenetworks',
|
||||
sa.Column('id', sa.String(length=36), nullable=False),
|
||||
sa.Column('vlan', sa.String(length=10), nullable=True),
|
||||
sa.PrimaryKeyConstraint('id'))
|
||||
|
||||
op.create_table(
|
||||
'brocadeports',
|
||||
sa.Column('port_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('network_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('admin_state_up', sa.Boolean(), nullable=False),
|
||||
sa.Column('physical_interface', sa.String(length=36), nullable=True),
|
||||
sa.Column('vlan_id', sa.String(length=36), nullable=True),
|
||||
sa.Column('tenant_id', sa.String(length=36), nullable=True),
|
||||
sa.ForeignKeyConstraint(['network_id'], ['brocadenetworks.id'], ),
|
||||
sa.PrimaryKeyConstraint('port_id'))
|
||||
|
||||
|
||||
def downgrade():
|
||||
op.drop_table('brocadeports')
|
||||
op.drop_table('brocadenetworks')
|
175
neutron/db/migration/alembic_migrations/cisco_init_ops.py
Normal file
175
neutron/db/migration/alembic_migrations/cisco_init_ops.py
Normal file
@ -0,0 +1,175 @@
|
||||
# Copyright 2014 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
# Initial schema operations for cisco plugin
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
segment_type = sa.Enum('vlan', 'overlay', 'trunk', 'multi-segment',
|
||||
name='segment_type')
|
||||
profile_type = sa.Enum('network', 'policy', name='profile_type')
|
||||
|
||||
|
||||
def upgrade():
|
||||
op.create_table(
|
||||
'cisco_policy_profiles',
|
||||
sa.Column('id', sa.String(length=36), nullable=False),
|
||||
sa.Column('name', sa.String(length=255), nullable=True),
|
||||
sa.PrimaryKeyConstraint('id'))
|
||||
|
||||
op.create_table(
|
||||
'cisco_n1kv_vlan_allocations',
|
||||
sa.Column('physical_network', sa.String(length=64), nullable=False),
|
||||
sa.Column('vlan_id', sa.Integer(), autoincrement=False,
|
||||
nullable=False),
|
||||
sa.Column('allocated', sa.Boolean(), autoincrement=False,
|
||||
nullable=False),
|
||||
sa.PrimaryKeyConstraint('physical_network', 'vlan_id'))
|
||||
|
||||
op.create_table(
|
||||
'cisco_network_profiles',
|
||||
sa.Column('id', sa.String(length=36), nullable=False),
|
||||
sa.Column('name', sa.String(length=255), nullable=True),
|
||||
sa.Column('segment_type', segment_type, nullable=False),
|
||||
sa.Column('sub_type', sa.String(length=255), nullable=True),
|
||||
sa.Column('segment_range', sa.String(length=255), nullable=True),
|
||||
sa.Column('multicast_ip_index', sa.Integer(), nullable=True),
|
||||
sa.Column('multicast_ip_range', sa.String(length=255), nullable=True),
|
||||
sa.Column('physical_network', sa.String(length=255), nullable=True),
|
||||
sa.PrimaryKeyConstraint('id'))
|
||||
|
||||
op.create_table(
|
||||
'cisco_n1kv_vxlan_allocations',
|
||||
sa.Column('vxlan_id', sa.Integer(), autoincrement=False,
|
||||
nullable=False),
|
||||
sa.Column('allocated', sa.Boolean(), nullable=False),
|
||||
sa.PrimaryKeyConstraint('vxlan_id'))
|
||||
|
||||
op.create_table(
|
||||
'cisco_credentials',
|
||||
sa.Column('credential_id', sa.String(length=255), nullable=True),
|
||||
sa.Column('credential_name', sa.String(length=255), nullable=False),
|
||||
sa.Column('user_name', sa.String(length=255), nullable=True),
|
||||
sa.Column('password', sa.String(length=255), nullable=True),
|
||||
sa.Column('type', sa.String(length=255), nullable=True),
|
||||
sa.PrimaryKeyConstraint('credential_name'))
|
||||
|
||||
op.create_table(
|
||||
'cisco_qos_policies',
|
||||
sa.Column('qos_id', sa.String(length=255), nullable=True),
|
||||
sa.Column('tenant_id', sa.String(length=255), nullable=False),
|
||||
sa.Column('qos_name', sa.String(length=255), nullable=False),
|
||||
sa.Column('qos_desc', sa.String(length=255), nullable=True),
|
||||
sa.PrimaryKeyConstraint('tenant_id', 'qos_name'))
|
||||
|
||||
op.create_table(
|
||||
'cisco_nexusport_bindings',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('port_id', sa.String(length=255), nullable=True),
|
||||
sa.Column('vlan_id', sa.Integer(), nullable=False),
|
||||
sa.Column('switch_ip', sa.String(length=255), nullable=False),
|
||||
sa.Column('instance_id', sa.String(length=255), nullable=False),
|
||||
sa.PrimaryKeyConstraint('id'))
|
||||
|
||||
op.create_table(
|
||||
'cisco_n1kv_profile_bindings',
|
||||
sa.Column('profile_type', profile_type, nullable=True),
|
||||
sa.Column('tenant_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('profile_id', sa.String(length=36), nullable=False),
|
||||
sa.PrimaryKeyConstraint('tenant_id', 'profile_id'))
|
||||
|
||||
op.create_table(
|
||||
'cisco_n1kv_vmnetworks',
|
||||
sa.Column('name', sa.String(length=80), nullable=False),
|
||||
sa.Column('profile_id', sa.String(length=36), nullable=True),
|
||||
sa.Column('network_id', sa.String(length=36), nullable=True),
|
||||
sa.Column('port_count', sa.Integer(), nullable=True),
|
||||
sa.ForeignKeyConstraint(['profile_id'],
|
||||
['cisco_policy_profiles.id'], ),
|
||||
sa.PrimaryKeyConstraint('name'))
|
||||
|
||||
op.create_table(
|
||||
'cisco_n1kv_trunk_segments',
|
||||
sa.Column('trunk_segment_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('segment_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('dot1qtag', sa.String(length=36), nullable=False),
|
||||
sa.ForeignKeyConstraint(['trunk_segment_id'], ['networks.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('trunk_segment_id', 'segment_id', 'dot1qtag'))
|
||||
|
||||
op.create_table(
|
||||
'cisco_provider_networks',
|
||||
sa.Column('network_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('network_type', sa.String(length=255), nullable=False),
|
||||
sa.Column('segmentation_id', sa.Integer(), nullable=False),
|
||||
sa.ForeignKeyConstraint(['network_id'], ['networks.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('network_id'))
|
||||
|
||||
op.create_table(
|
||||
'cisco_n1kv_multi_segments',
|
||||
sa.Column('multi_segment_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('segment1_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('segment2_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('encap_profile_name', sa.String(length=36), nullable=True),
|
||||
sa.ForeignKeyConstraint(['multi_segment_id'], ['networks.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('multi_segment_id', 'segment1_id',
|
||||
'segment2_id'))
|
||||
|
||||
op.create_table(
|
||||
'cisco_n1kv_network_bindings',
|
||||
sa.Column('network_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('network_type', sa.String(length=32), nullable=False),
|
||||
sa.Column('physical_network', sa.String(length=64), nullable=True),
|
||||
sa.Column('segmentation_id', sa.Integer(), nullable=True),
|
||||
sa.Column('multicast_ip', sa.String(length=32), nullable=True),
|
||||
sa.Column('profile_id', sa.String(length=36), nullable=True),
|
||||
sa.ForeignKeyConstraint(['network_id'], ['networks.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.ForeignKeyConstraint(['profile_id'],
|
||||
['cisco_network_profiles.id']),
|
||||
sa.PrimaryKeyConstraint('network_id'))
|
||||
|
||||
op.create_table(
|
||||
'cisco_n1kv_port_bindings',
|
||||
sa.Column('port_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('profile_id', sa.String(length=36), nullable=True),
|
||||
sa.ForeignKeyConstraint(['port_id'], ['ports.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.ForeignKeyConstraint(['profile_id'], ['cisco_policy_profiles.id']),
|
||||
sa.PrimaryKeyConstraint('port_id'))
|
||||
|
||||
|
||||
def downgrade():
|
||||
op.drop_table('cisco_n1kv_port_bindings')
|
||||
op.drop_table('cisco_n1kv_network_bindings')
|
||||
op.drop_table('cisco_n1kv_multi_segments')
|
||||
op.drop_table('cisco_provider_networks')
|
||||
op.drop_table('cisco_n1kv_trunk_segments')
|
||||
op.drop_table('cisco_n1kv_vmnetworks')
|
||||
op.drop_table('cisco_n1kv_profile_bindings')
|
||||
op.drop_table('cisco_nexusport_bindings')
|
||||
op.drop_table('cisco_qos_policies')
|
||||
op.drop_table('cisco_credentials')
|
||||
op.drop_table('cisco_n1kv_vxlan_allocations')
|
||||
op.drop_table('cisco_network_profiles')
|
||||
op.drop_table('cisco_n1kv_vlan_allocations')
|
||||
op.drop_table('cisco_policy_profiles')
|
||||
# generate DDL for dropping enumns
|
||||
segment_type.drop(op.get_bind(), checkfirst=False)
|
||||
profile_type.drop(op.get_bind(), checkfirst=False)
|
129
neutron/db/migration/alembic_migrations/core_init_ops.py
Normal file
129
neutron/db/migration/alembic_migrations/core_init_ops.py
Normal file
@ -0,0 +1,129 @@
|
||||
# Copyright 2014 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
# Initial operations for core resources
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
def upgrade():
|
||||
op.create_table(
|
||||
'networks',
|
||||
sa.Column('tenant_id', sa.String(length=255), nullable=True),
|
||||
sa.Column('id', sa.String(length=36), nullable=False),
|
||||
sa.Column('name', sa.String(length=255), nullable=True),
|
||||
sa.Column('status', sa.String(length=16), nullable=True),
|
||||
sa.Column('admin_state_up', sa.Boolean(), nullable=True),
|
||||
sa.Column('shared', sa.Boolean(), nullable=True),
|
||||
sa.PrimaryKeyConstraint('id'))
|
||||
|
||||
op.create_table(
|
||||
'ports',
|
||||
sa.Column('tenant_id', sa.String(length=255), nullable=True),
|
||||
sa.Column('id', sa.String(length=36), nullable=False),
|
||||
sa.Column('name', sa.String(length=255), nullable=True),
|
||||
sa.Column('network_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('mac_address', sa.String(length=32), nullable=False),
|
||||
sa.Column('admin_state_up', sa.Boolean(), nullable=False),
|
||||
sa.Column('status', sa.String(length=16), nullable=False),
|
||||
sa.Column('device_id', sa.String(length=255), nullable=False),
|
||||
sa.Column('device_owner', sa.String(length=255), nullable=False),
|
||||
sa.ForeignKeyConstraint(['network_id'], ['networks.id'], ),
|
||||
sa.PrimaryKeyConstraint('id'))
|
||||
|
||||
op.create_table(
|
||||
'subnets',
|
||||
sa.Column('tenant_id', sa.String(length=255), nullable=True),
|
||||
sa.Column('id', sa.String(length=36), nullable=False),
|
||||
sa.Column('name', sa.String(length=255), nullable=True),
|
||||
sa.Column('network_id', sa.String(length=36), nullable=True),
|
||||
sa.Column('ip_version', sa.Integer(), nullable=False),
|
||||
sa.Column('cidr', sa.String(length=64), nullable=False),
|
||||
sa.Column('gateway_ip', sa.String(length=64), nullable=True),
|
||||
sa.Column('enable_dhcp', sa.Boolean(), nullable=True),
|
||||
sa.Column('shared', sa.Boolean(), nullable=True),
|
||||
sa.ForeignKeyConstraint(['network_id'], ['networks.id'], ),
|
||||
sa.PrimaryKeyConstraint('id'))
|
||||
|
||||
op.create_table(
|
||||
'dnsnameservers',
|
||||
sa.Column('address', sa.String(length=128), nullable=False),
|
||||
sa.Column('subnet_id', sa.String(length=36), nullable=False),
|
||||
sa.ForeignKeyConstraint(['subnet_id'], ['subnets.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('address', 'subnet_id'))
|
||||
|
||||
op.create_table(
|
||||
'ipallocationpools',
|
||||
sa.Column('id', sa.String(length=36), nullable=False),
|
||||
sa.Column('subnet_id', sa.String(length=36), nullable=True),
|
||||
sa.Column('first_ip', sa.String(length=64), nullable=False),
|
||||
sa.Column('last_ip', sa.String(length=64), nullable=False),
|
||||
sa.ForeignKeyConstraint(['subnet_id'], ['subnets.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('id'))
|
||||
|
||||
op.create_table(
|
||||
'subnetroutes',
|
||||
sa.Column('destination', sa.String(length=64), nullable=False),
|
||||
sa.Column('nexthop', sa.String(length=64), nullable=False),
|
||||
sa.Column('subnet_id', sa.String(length=36), nullable=False),
|
||||
sa.ForeignKeyConstraint(['subnet_id'], ['subnets.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('destination', 'nexthop', 'subnet_id'))
|
||||
|
||||
op.create_table(
|
||||
'ipallocations',
|
||||
sa.Column('port_id', sa.String(length=36), nullable=True),
|
||||
sa.Column('ip_address', sa.String(length=64), nullable=False),
|
||||
sa.Column('subnet_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('network_id', sa.String(length=36), nullable=False),
|
||||
sa.ForeignKeyConstraint(['network_id'], ['networks.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.ForeignKeyConstraint(['port_id'], ['ports.id'], ondelete='CASCADE'),
|
||||
sa.ForeignKeyConstraint(['subnet_id'], ['subnets.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('ip_address', 'subnet_id', 'network_id'))
|
||||
|
||||
op.create_table(
|
||||
'ipavailabilityranges',
|
||||
sa.Column('allocation_pool_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('first_ip', sa.String(length=64), nullable=False),
|
||||
sa.Column('last_ip', sa.String(length=64), nullable=False),
|
||||
sa.ForeignKeyConstraint(['allocation_pool_id'],
|
||||
['ipallocationpools.id'], ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('allocation_pool_id', 'first_ip', 'last_ip'))
|
||||
|
||||
op.create_table(
|
||||
'networkdhcpagentbindings',
|
||||
sa.Column('network_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('dhcp_agent_id', sa.String(length=36), nullable=False),
|
||||
sa.ForeignKeyConstraint(['dhcp_agent_id'], ['agents.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.ForeignKeyConstraint(['network_id'], ['networks.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('network_id', 'dhcp_agent_id'))
|
||||
|
||||
|
||||
def downgrade():
|
||||
op.drop_table('networkdhcpagentbindings')
|
||||
op.drop_table('ipavailabilityranges')
|
||||
op.drop_table('ipallocations')
|
||||
op.drop_table('subnetroutes')
|
||||
op.drop_table('ipallocationpools')
|
||||
op.drop_table('dnsnameservers')
|
||||
op.drop_table('subnets')
|
||||
op.drop_table('ports')
|
||||
op.drop_table('networks')
|
@ -1,4 +1,4 @@
|
||||
# Copyright 2013 OpenStack Foundation
|
||||
# Copyright 2014 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
@ -13,71 +13,42 @@
|
||||
# under the License.
|
||||
#
|
||||
|
||||
"""FWaaS Havana-2 model
|
||||
# Initial schema operations for firewall service plugin
|
||||
|
||||
Revision ID: 39cf3f799352
|
||||
Revises: e6b16a30d97
|
||||
Create Date: 2013-07-10 16:16:51.302943
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '39cf3f799352'
|
||||
down_revision = 'e6b16a30d97'
|
||||
|
||||
# Change to ['*'] if this migration applies to all plugins
|
||||
|
||||
migration_for_plugins = [
|
||||
'neutron.services.firewall.fwaas_plugin.FirewallPlugin',
|
||||
]
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
from neutron.db import migration
|
||||
|
||||
firewallrules_action = sa.Enum('allow', 'deny', name='firewallrules_action')
|
||||
action_types = sa.Enum('allow', 'deny', name='firewallrules_action')
|
||||
|
||||
|
||||
def downgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.drop_table('firewall_rules')
|
||||
firewallrules_action.drop(op.get_bind(), checkfirst=False)
|
||||
op.drop_table('firewalls')
|
||||
op.drop_table('firewall_policies')
|
||||
|
||||
|
||||
def upgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
def upgrade():
|
||||
op.create_table(
|
||||
'firewall_policies',
|
||||
sa.Column('tenant_id', sa.String(length=255), nullable=True),
|
||||
sa.Column('id', sa.String(length=36), nullable=False),
|
||||
sa.Column('name', sa.String(length=255), nullable=True),
|
||||
sa.Column('description', sa.String(length=1024), nullable=True),
|
||||
sa.Column('shared', sa.Boolean(), autoincrement=False, nullable=True),
|
||||
sa.Column('audited', sa.Boolean(), autoincrement=False,
|
||||
nullable=True),
|
||||
sa.Column('shared', sa.Boolean(), nullable=True),
|
||||
sa.Column('audited', sa.Boolean(), nullable=True),
|
||||
sa.PrimaryKeyConstraint('id'))
|
||||
|
||||
op.create_table(
|
||||
'firewalls', sa.Column('tenant_id', sa.String(length=255),
|
||||
nullable=True),
|
||||
'firewalls',
|
||||
sa.Column('tenant_id', sa.String(length=255), nullable=True),
|
||||
sa.Column('id', sa.String(length=36), nullable=False),
|
||||
sa.Column('name', sa.String(length=255), nullable=True),
|
||||
sa.Column('description', sa.String(length=1024), nullable=True),
|
||||
sa.Column('shared', sa.Boolean(), autoincrement=False, nullable=True),
|
||||
sa.Column('admin_state_up', sa.Boolean(), autoincrement=False,
|
||||
nullable=True),
|
||||
sa.Column('shared', sa.Boolean(), nullable=True),
|
||||
sa.Column('admin_state_up', sa.Boolean(), nullable=True),
|
||||
sa.Column('status', sa.String(length=16), nullable=True),
|
||||
sa.Column('firewall_policy_id', sa.String(length=36), nullable=True),
|
||||
sa.ForeignKeyConstraint(['firewall_policy_id'],
|
||||
['firewall_policies.id'],
|
||||
name='firewalls_ibfk_1'),
|
||||
sa.PrimaryKeyConstraint('id'))
|
||||
|
||||
op.create_table(
|
||||
'firewall_rules',
|
||||
sa.Column('tenant_id', sa.String(length=255), nullable=True),
|
||||
@ -85,11 +56,9 @@ def upgrade(active_plugins=None, options=None):
|
||||
sa.Column('name', sa.String(length=255), nullable=True),
|
||||
sa.Column('description', sa.String(length=1024), nullable=True),
|
||||
sa.Column('firewall_policy_id', sa.String(length=36), nullable=True),
|
||||
sa.Column('shared', sa.Boolean(), autoincrement=False,
|
||||
nullable=True),
|
||||
sa.Column('protocol', sa.String(length=24), nullable=True),
|
||||
sa.Column('ip_version', sa.Integer(), autoincrement=False,
|
||||
nullable=False),
|
||||
sa.Column('shared', sa.Boolean(), nullable=True),
|
||||
sa.Column('protocol', sa.String(length=40), nullable=True),
|
||||
sa.Column('ip_version', sa.Integer(), nullable=False),
|
||||
sa.Column('source_ip_address', sa.String(length=46), nullable=True),
|
||||
sa.Column('destination_ip_address', sa.String(length=46),
|
||||
nullable=True),
|
||||
@ -97,12 +66,17 @@ def upgrade(active_plugins=None, options=None):
|
||||
sa.Column('source_port_range_max', sa.Integer(), nullable=True),
|
||||
sa.Column('destination_port_range_min', sa.Integer(), nullable=True),
|
||||
sa.Column('destination_port_range_max', sa.Integer(), nullable=True),
|
||||
sa.Column('action', firewallrules_action, nullable=True),
|
||||
sa.Column('enabled', sa.Boolean(), autoincrement=False,
|
||||
nullable=True),
|
||||
sa.Column('position', sa.Integer(), autoincrement=False,
|
||||
nullable=True),
|
||||
sa.Column('action', action_types, nullable=True),
|
||||
sa.Column('enabled', sa.Boolean(), nullable=True),
|
||||
sa.Column('position', sa.Integer(), nullable=True),
|
||||
sa.ForeignKeyConstraint(['firewall_policy_id'],
|
||||
['firewall_policies.id'],
|
||||
name='firewall_rules_ibfk_1'),
|
||||
sa.PrimaryKeyConstraint('id'))
|
||||
|
||||
|
||||
def downgrade():
|
||||
op.drop_table('firewall_rules')
|
||||
op.drop_table('firewalls')
|
||||
op.drop_table('firewall_policies')
|
||||
action_types.drop(op.get_bind(), checkfirst=False)
|
@ -1,4 +1,4 @@
|
||||
# Copyright 2013 Openstack Foundation
|
||||
# Copyright 2014 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
@ -13,15 +13,20 @@
|
||||
# under the License.
|
||||
#
|
||||
|
||||
"""
|
||||
Upgrade/downgrade operations for 'community' extensions
|
||||
"""
|
||||
# Initial operations for l3 extension
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
def upgrade_l3():
|
||||
def upgrade():
|
||||
op.create_table(
|
||||
'externalnetworks',
|
||||
sa.Column('network_id', sa.String(length=36), nullable=False),
|
||||
sa.ForeignKeyConstraint(['network_id'], ['networks.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('network_id'))
|
||||
|
||||
op.create_table(
|
||||
'routers',
|
||||
sa.Column('tenant_id', sa.String(length=255), nullable=True),
|
||||
@ -30,17 +35,10 @@ def upgrade_l3():
|
||||
sa.Column('status', sa.String(length=16), nullable=True),
|
||||
sa.Column('admin_state_up', sa.Boolean(), nullable=True),
|
||||
sa.Column('gw_port_id', sa.String(length=36), nullable=True),
|
||||
sa.Column('enable_snat', sa.Boolean(), nullable=False,
|
||||
server_default=sa.sql.true()),
|
||||
sa.ForeignKeyConstraint(['gw_port_id'], ['ports.id'], ),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
|
||||
op.create_table(
|
||||
'externalnetworks',
|
||||
sa.Column('network_id', sa.String(length=36), nullable=False),
|
||||
sa.ForeignKeyConstraint(['network_id'], ['networks.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('network_id')
|
||||
)
|
||||
sa.PrimaryKeyConstraint('id'))
|
||||
|
||||
op.create_table(
|
||||
'floatingips',
|
||||
@ -55,25 +53,32 @@ def upgrade_l3():
|
||||
sa.ForeignKeyConstraint(['fixed_port_id'], ['ports.id'], ),
|
||||
sa.ForeignKeyConstraint(['floating_port_id'], ['ports.id'], ),
|
||||
sa.ForeignKeyConstraint(['router_id'], ['routers.id'], ),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
sa.PrimaryKeyConstraint('id'))
|
||||
|
||||
|
||||
def upgrade_quota():
|
||||
op.create_table(
|
||||
'quotas',
|
||||
'routerroutes',
|
||||
sa.Column('destination', sa.String(length=64), nullable=False),
|
||||
sa.Column('nexthop', sa.String(length=64), nullable=False),
|
||||
sa.Column('router_id', sa.String(length=36), nullable=False),
|
||||
sa.ForeignKeyConstraint(['router_id'], ['routers.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('destination', 'nexthop', 'router_id'))
|
||||
|
||||
op.create_table(
|
||||
'routerl3agentbindings',
|
||||
sa.Column('id', sa.String(length=36), nullable=False),
|
||||
sa.Column('tenant_id', sa.String(255), index=True),
|
||||
sa.Column('resource', sa.String(255)),
|
||||
sa.Column('limit', sa.Integer()),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
sa.Column('router_id', sa.String(length=36), nullable=True),
|
||||
sa.Column('l3_agent_id', sa.String(length=36), nullable=True),
|
||||
sa.ForeignKeyConstraint(['l3_agent_id'], ['agents.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.ForeignKeyConstraint(['router_id'], ['routers.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('id'))
|
||||
|
||||
|
||||
def downgrade_l3():
|
||||
for table in ('floatingips', 'routers', 'externalnetworks'):
|
||||
op.drop_table(table)
|
||||
|
||||
|
||||
def downgrade_quota():
|
||||
op.drop_table('quotas')
|
||||
def downgrade():
|
||||
op.drop_table('routerl3agentbindings')
|
||||
op.drop_table('routerroutes')
|
||||
op.drop_table('floatingips')
|
||||
op.drop_table('routers')
|
||||
op.drop_table('externalnetworks')
|
43
neutron/db/migration/alembic_migrations/lb_init_ops.py
Normal file
43
neutron/db/migration/alembic_migrations/lb_init_ops.py
Normal file
@ -0,0 +1,43 @@
|
||||
# Copyright 2014 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
# Initial operations for the port security extension
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
def upgrade():
|
||||
op.create_table(
|
||||
'network_states',
|
||||
sa.Column('physical_network', sa.String(length=64), nullable=False),
|
||||
sa.Column('vlan_id', sa.Integer(), autoincrement=False,
|
||||
nullable=False),
|
||||
sa.Column('allocated', sa.Boolean(), nullable=False),
|
||||
sa.PrimaryKeyConstraint('physical_network', 'vlan_id'))
|
||||
|
||||
op.create_table(
|
||||
'network_bindings',
|
||||
sa.Column('network_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('physical_network', sa.String(length=64), nullable=True),
|
||||
sa.Column('vlan_id', sa.Integer(), nullable=False),
|
||||
sa.ForeignKeyConstraint(['network_id'], ['networks.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('network_id'))
|
||||
|
||||
|
||||
def downgrade():
|
||||
op.drop_table('network_bindings')
|
||||
op.drop_table('network_states')
|
147
neutron/db/migration/alembic_migrations/loadbalancer_init_ops.py
Normal file
147
neutron/db/migration/alembic_migrations/loadbalancer_init_ops.py
Normal file
@ -0,0 +1,147 @@
|
||||
# Copyright 2014 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
# Initial schema operations for the load balancer service plugin
|
||||
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
protocols = sa.Enum('HTTP', 'HTTPS', 'TCP', name='lb_protocols')
|
||||
session_persistence_type = sa.Enum('SOURCE_IP', 'HTTP_COOKIE', 'APP_COOKIE',
|
||||
name='sesssionpersistences_type')
|
||||
lb_methods = sa.Enum('ROUND_ROBIN', 'LEAST_CONNECTIONS', 'SOURCE_IP',
|
||||
name='pools_lb_method')
|
||||
health_monitor_type = sa.Enum('PING', 'TCP', 'HTTP', 'HTTPS',
|
||||
name='healthmontiors_type')
|
||||
|
||||
|
||||
def upgrade():
|
||||
op.create_table(
|
||||
'healthmonitors',
|
||||
sa.Column('tenant_id', sa.String(length=255), nullable=True),
|
||||
sa.Column('id', sa.String(length=36), nullable=False),
|
||||
sa.Column('type', health_monitor_type, nullable=False),
|
||||
sa.Column('delay', sa.Integer(), nullable=False),
|
||||
sa.Column('timeout', sa.Integer(), nullable=False),
|
||||
sa.Column('max_retries', sa.Integer(), nullable=False),
|
||||
sa.Column('http_method', sa.String(length=16), nullable=True),
|
||||
sa.Column('url_path', sa.String(length=255), nullable=True),
|
||||
sa.Column('expected_codes', sa.String(length=64), nullable=True),
|
||||
sa.Column('admin_state_up', sa.Boolean(), nullable=False),
|
||||
sa.PrimaryKeyConstraint('id'))
|
||||
|
||||
op.create_table(
|
||||
'vips',
|
||||
sa.Column('tenant_id', sa.String(length=255), nullable=True),
|
||||
sa.Column('id', sa.String(length=36), nullable=False),
|
||||
sa.Column('status', sa.String(length=16), nullable=False),
|
||||
sa.Column('status_description', sa.String(length=255), nullable=True),
|
||||
sa.Column('name', sa.String(length=255), nullable=True),
|
||||
sa.Column('description', sa.String(length=255), nullable=True),
|
||||
sa.Column('port_id', sa.String(length=36), nullable=True),
|
||||
sa.Column('protocol_port', sa.Integer(), nullable=False),
|
||||
sa.Column('protocol', protocols, nullable=False),
|
||||
sa.Column('pool_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('admin_state_up', sa.Boolean(), nullable=False),
|
||||
sa.Column('connection_limit', sa.Integer(), nullable=True),
|
||||
sa.ForeignKeyConstraint(['port_id'], ['ports.id'], ),
|
||||
sa.PrimaryKeyConstraint('id'),
|
||||
sa.UniqueConstraint('pool_id'))
|
||||
|
||||
op.create_table(
|
||||
'pools',
|
||||
sa.Column('tenant_id', sa.String(length=255), nullable=True),
|
||||
sa.Column('id', sa.String(length=36), nullable=False),
|
||||
sa.Column('status', sa.String(length=16), nullable=False),
|
||||
sa.Column('status_description', sa.String(length=255), nullable=True),
|
||||
sa.Column('vip_id', sa.String(length=36), nullable=True),
|
||||
sa.Column('name', sa.String(length=255), nullable=True),
|
||||
sa.Column('description', sa.String(length=255), nullable=True),
|
||||
sa.Column('subnet_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('protocol', protocols, nullable=False),
|
||||
sa.Column('lb_method', lb_methods, nullable=False),
|
||||
sa.Column('admin_state_up', sa.Boolean(), nullable=False),
|
||||
sa.ForeignKeyConstraint(['vip_id'], ['vips.id'], ),
|
||||
sa.PrimaryKeyConstraint('id'))
|
||||
|
||||
op.create_table(
|
||||
'sessionpersistences',
|
||||
sa.Column('vip_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('type', session_persistence_type, nullable=False),
|
||||
sa.Column('cookie_name', sa.String(length=1024), nullable=True),
|
||||
sa.ForeignKeyConstraint(['vip_id'], ['vips.id'], ),
|
||||
sa.PrimaryKeyConstraint('vip_id'))
|
||||
|
||||
op.create_table(
|
||||
'poolloadbalanceragentbindings',
|
||||
sa.Column('pool_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('agent_id', sa.String(length=36), nullable=False),
|
||||
sa.ForeignKeyConstraint(['pool_id'], ['pools.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.ForeignKeyConstraint(['agent_id'], ['agents.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('pool_id'))
|
||||
|
||||
op.create_table(
|
||||
'members',
|
||||
sa.Column('tenant_id', sa.String(length=255), nullable=True),
|
||||
sa.Column('id', sa.String(length=36), nullable=False),
|
||||
sa.Column('status', sa.String(length=16), nullable=False),
|
||||
sa.Column('status_description', sa.String(length=255), nullable=True),
|
||||
sa.Column('pool_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('address', sa.String(length=64), nullable=False),
|
||||
sa.Column('protocol_port', sa.Integer(), nullable=False),
|
||||
sa.Column('weight', sa.Integer(), nullable=False),
|
||||
sa.Column('admin_state_up', sa.Boolean(), nullable=False),
|
||||
sa.ForeignKeyConstraint(['pool_id'], ['pools.id'], ),
|
||||
sa.PrimaryKeyConstraint('id'))
|
||||
|
||||
op.create_table(
|
||||
'poolmonitorassociations',
|
||||
sa.Column('status', sa.String(length=16), nullable=False,
|
||||
server_default=''),
|
||||
sa.Column('status_description', sa.String(length=255), nullable=True),
|
||||
sa.Column('pool_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('monitor_id', sa.String(length=36), nullable=False),
|
||||
sa.ForeignKeyConstraint(['pool_id'], ['pools.id'], ),
|
||||
sa.ForeignKeyConstraint(['monitor_id'], ['healthmonitors.id'], ),
|
||||
sa.PrimaryKeyConstraint('pool_id', 'monitor_id'))
|
||||
|
||||
op.create_table(
|
||||
'poolstatisticss',
|
||||
sa.Column('pool_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('bytes_in', sa.Integer(), nullable=False),
|
||||
sa.Column('bytes_out', sa.Integer(), nullable=False),
|
||||
sa.Column('active_connections', sa.Integer(), nullable=False),
|
||||
sa.Column('total_connections', sa.Integer(), nullable=False),
|
||||
sa.ForeignKeyConstraint(['pool_id'], ['pools.id'], ),
|
||||
sa.PrimaryKeyConstraint('pool_id'))
|
||||
|
||||
|
||||
def downgrade():
|
||||
op.drop_table('poolstatisticss')
|
||||
op.drop_table('poolmonitorassociations')
|
||||
op.drop_table('members')
|
||||
op.drop_table('poolloadbalanceragentbindings')
|
||||
op.drop_table('sessionpersistences')
|
||||
op.drop_table('pools')
|
||||
op.drop_table('vips')
|
||||
op.drop_table('healthmonitors')
|
||||
protocols.drop(op.get_bind(), checkfirst=False)
|
||||
session_persistence_type.drop(op.get_bind(), checkfirst=False)
|
||||
lb_methods.drop(op.get_bind(), checkfirst=False)
|
||||
health_monitor_type.drop(op.get_bind(), checkfirst=False)
|
52
neutron/db/migration/alembic_migrations/metering_init_ops.py
Normal file
52
neutron/db/migration/alembic_migrations/metering_init_ops.py
Normal file
@ -0,0 +1,52 @@
|
||||
# Copyright 2014 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
# Initial operations for the metering service plugin
|
||||
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
direction = sa.Enum('ingress', 'egress',
|
||||
name='meteringlabels_direction')
|
||||
|
||||
|
||||
def upgrade():
|
||||
op.create_table(
|
||||
'meteringlabels',
|
||||
sa.Column('tenant_id', sa.String(length=255), nullable=True),
|
||||
sa.Column('id', sa.String(length=36), nullable=False),
|
||||
sa.Column('name', sa.String(length=255), nullable=True),
|
||||
sa.Column('description', sa.String(length=1024), nullable=True),
|
||||
sa.PrimaryKeyConstraint('id'))
|
||||
|
||||
op.create_table(
|
||||
'meteringlabelrules',
|
||||
sa.Column('id', sa.String(length=36), nullable=False),
|
||||
sa.Column('direction', direction, nullable=True),
|
||||
sa.Column('remote_ip_prefix', sa.String(length=64), nullable=True),
|
||||
sa.Column('metering_label_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('excluded', sa.Boolean(), nullable=True),
|
||||
sa.ForeignKeyConstraint(['metering_label_id'],
|
||||
['meteringlabels.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('id'))
|
||||
|
||||
|
||||
def downgrade():
|
||||
op.drop_table('meteringlabelrules')
|
||||
op.drop_table('meteringlabels')
|
||||
direction.drop(op.get_bind(), checkfirst=False)
|
148
neutron/db/migration/alembic_migrations/ml2_init_ops.py
Normal file
148
neutron/db/migration/alembic_migrations/ml2_init_ops.py
Normal file
@ -0,0 +1,148 @@
|
||||
# Copyright 2014 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
# Initial operations for ML2 plugin and drivers
|
||||
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
def upgrade():
|
||||
op.create_table(
|
||||
'ml2_vlan_allocations',
|
||||
sa.Column('physical_network', sa.String(length=64), nullable=False),
|
||||
sa.Column('vlan_id', sa.Integer(), autoincrement=False,
|
||||
nullable=False),
|
||||
sa.Column('allocated', sa.Boolean(), nullable=False),
|
||||
sa.PrimaryKeyConstraint('physical_network', 'vlan_id'))
|
||||
|
||||
op.create_table(
|
||||
'ml2_vxlan_endpoints',
|
||||
sa.Column('ip_address', sa.String(length=64), nullable=False),
|
||||
sa.Column('udp_port', sa.Integer(), autoincrement=False,
|
||||
nullable=False),
|
||||
sa.PrimaryKeyConstraint('ip_address', 'udp_port'))
|
||||
|
||||
op.create_table(
|
||||
'ml2_gre_endpoints',
|
||||
sa.Column('ip_address', sa.String(length=64), nullable=False),
|
||||
sa.PrimaryKeyConstraint('ip_address'))
|
||||
|
||||
op.create_table(
|
||||
'ml2_vxlan_allocations',
|
||||
sa.Column('vxlan_vni', sa.Integer(), autoincrement=False,
|
||||
nullable=False),
|
||||
sa.Column('allocated', sa.Boolean(), nullable=False),
|
||||
sa.PrimaryKeyConstraint('vxlan_vni'))
|
||||
|
||||
op.create_table(
|
||||
'ml2_gre_allocations',
|
||||
sa.Column('gre_id', sa.Integer(), autoincrement=False,
|
||||
nullable=False),
|
||||
sa.Column('allocated', sa.Boolean(), nullable=False),
|
||||
sa.PrimaryKeyConstraint('gre_id'))
|
||||
|
||||
op.create_table(
|
||||
'ml2_flat_allocations',
|
||||
sa.Column('physical_network', sa.String(length=64), nullable=False),
|
||||
sa.PrimaryKeyConstraint('physical_network'))
|
||||
|
||||
op.create_table(
|
||||
'ml2_network_segments',
|
||||
sa.Column('id', sa.String(length=36), nullable=False),
|
||||
sa.Column('network_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('network_type', sa.String(length=32), nullable=False),
|
||||
sa.Column('physical_network', sa.String(length=64), nullable=True),
|
||||
sa.Column('segmentation_id', sa.Integer(), nullable=True),
|
||||
sa.ForeignKeyConstraint(['network_id'], ['networks.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('id'))
|
||||
|
||||
op.create_table(
|
||||
'ml2_port_bindings',
|
||||
sa.Column('port_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('host', sa.String(length=255), nullable=False),
|
||||
sa.Column('vif_type', sa.String(length=64), nullable=False),
|
||||
sa.Column('cap_port_filter', sa.Boolean(), nullable=False),
|
||||
sa.Column('driver', sa.String(length=64), nullable=True),
|
||||
sa.Column('segment', sa.String(length=36), nullable=True),
|
||||
sa.ForeignKeyConstraint(['port_id'], ['ports.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.ForeignKeyConstraint(['segment'], ['ml2_network_segments.id'],
|
||||
ondelete='SET NULL'),
|
||||
sa.PrimaryKeyConstraint('port_id'))
|
||||
|
||||
op.create_table(
|
||||
'cisco_ml2_nexusport_bindings',
|
||||
sa.Column('binding_id', sa.Integer(), nullable=False),
|
||||
sa.Column('port_id', sa.String(length=255), nullable=True),
|
||||
sa.Column('vlan_id', sa.Integer(), autoincrement=False,
|
||||
nullable=False),
|
||||
sa.Column('switch_ip', sa.String(length=255), nullable=True),
|
||||
sa.Column('instance_id', sa.String(length=255), nullable=True),
|
||||
sa.PrimaryKeyConstraint('binding_id'),
|
||||
)
|
||||
|
||||
op.create_table(
|
||||
'cisco_ml2_credentials',
|
||||
sa.Column('credential_id', sa.String(length=255), nullable=True),
|
||||
sa.Column('tenant_id', sa.String(length=255), nullable=False),
|
||||
sa.Column('credential_name', sa.String(length=255), nullable=False),
|
||||
sa.Column('user_name', sa.String(length=255), nullable=True),
|
||||
sa.Column('password', sa.String(length=255), nullable=True),
|
||||
sa.PrimaryKeyConstraint('tenant_id', 'credential_name'),
|
||||
)
|
||||
|
||||
op.create_table(
|
||||
'arista_provisioned_nets',
|
||||
sa.Column('tenant_id', sa.String(length=255), nullable=True),
|
||||
sa.Column('id', sa.String(length=36), nullable=False),
|
||||
sa.Column('network_id', sa.String(length=36), nullable=True),
|
||||
sa.Column('segmentation_id', sa.Integer(),
|
||||
autoincrement=False, nullable=True),
|
||||
sa.PrimaryKeyConstraint('id'))
|
||||
|
||||
op.create_table(
|
||||
'arista_provisioned_vms',
|
||||
sa.Column('tenant_id', sa.String(length=255), nullable=True),
|
||||
sa.Column('id', sa.String(length=36), nullable=False),
|
||||
sa.Column('vm_id', sa.String(length=255), nullable=True),
|
||||
sa.Column('host_id', sa.String(length=255), nullable=True),
|
||||
sa.Column('port_id', sa.String(length=36), nullable=True),
|
||||
sa.Column('network_id', sa.String(length=36), nullable=True),
|
||||
sa.PrimaryKeyConstraint('id'))
|
||||
|
||||
op.create_table(
|
||||
'arista_provisioned_tenants',
|
||||
sa.Column('tenant_id', sa.String(length=255), nullable=True),
|
||||
sa.Column('id', sa.String(length=36), nullable=False),
|
||||
sa.PrimaryKeyConstraint('id'))
|
||||
|
||||
|
||||
def downgrade():
|
||||
op.drop_table('arista_provisioned_tenants')
|
||||
op.drop_table('arista_provisioned_vms')
|
||||
op.drop_table('arista_provisioned_nets')
|
||||
op.drop_table('cisco_ml2_credentials')
|
||||
op.drop_table('cisco_ml2_nexusport_bindings')
|
||||
op.drop_table('ml2_port_bindings')
|
||||
op.drop_table('ml2_network_segments')
|
||||
op.drop_table('ml2_flat_allocations')
|
||||
op.drop_table('ml2_gre_allocations')
|
||||
op.drop_table('ml2_vxlan_allocations')
|
||||
op.drop_table('ml2_gre_endpoints')
|
||||
op.drop_table('ml2_vxlan_endpoints')
|
||||
op.drop_table('ml2_vlan_allocations')
|
53
neutron/db/migration/alembic_migrations/mlnx_init_ops.py
Normal file
53
neutron/db/migration/alembic_migrations/mlnx_init_ops.py
Normal file
@ -0,0 +1,53 @@
|
||||
# Copyright 2014 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
# Initial operations for the Mellanox plugin
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
def upgrade():
|
||||
op.create_table(
|
||||
'segmentation_id_allocation',
|
||||
sa.Column('physical_network', sa.String(length=64), nullable=False),
|
||||
sa.Column('segmentation_id', sa.Integer(), autoincrement=False,
|
||||
nullable=False),
|
||||
sa.Column('allocated', sa.Boolean(), nullable=False),
|
||||
sa.PrimaryKeyConstraint('physical_network', 'segmentation_id'))
|
||||
|
||||
op.create_table(
|
||||
'mlnx_network_bindings',
|
||||
sa.Column('network_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('network_type', sa.String(length=32), nullable=False),
|
||||
sa.Column('physical_network', sa.String(length=64), nullable=True),
|
||||
sa.Column('segmentation_id', sa.Integer(), nullable=False),
|
||||
sa.ForeignKeyConstraint(['network_id'], ['networks.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('network_id'))
|
||||
|
||||
op.create_table(
|
||||
'port_profile',
|
||||
sa.Column('port_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('vnic_type', sa.String(length=32), nullable=False),
|
||||
sa.ForeignKeyConstraint(['port_id'], ['ports.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('port_id'))
|
||||
|
||||
|
||||
def downgrade():
|
||||
op.drop_table('port_profile')
|
||||
op.drop_table('mlnx_network_bindings')
|
||||
op.drop_table('segmentation_id_allocation')
|
139
neutron/db/migration/alembic_migrations/nec_init_ops.py
Normal file
139
neutron/db/migration/alembic_migrations/nec_init_ops.py
Normal file
@ -0,0 +1,139 @@
|
||||
# Copyright 2014 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
# Initial operations for NEC plugin
|
||||
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
def upgrade():
|
||||
op.create_table(
|
||||
'ofcportmappings',
|
||||
sa.Column('ofc_id', sa.String(length=255), nullable=False),
|
||||
sa.Column('quantum_id', sa.String(length=36), nullable=False),
|
||||
sa.PrimaryKeyConstraint('quantum_id'),
|
||||
sa.UniqueConstraint('ofc_id'))
|
||||
|
||||
op.create_table(
|
||||
'ofcroutermappings',
|
||||
sa.Column('ofc_id', sa.String(length=255), nullable=False),
|
||||
sa.Column('quantum_id', sa.String(length=36), nullable=False),
|
||||
sa.PrimaryKeyConstraint('quantum_id'),
|
||||
sa.UniqueConstraint('ofc_id'))
|
||||
|
||||
op.create_table(
|
||||
'routerproviders',
|
||||
sa.Column('provider', sa.String(length=255), nullable=True),
|
||||
sa.Column('router_id', sa.String(length=36), nullable=False),
|
||||
sa.ForeignKeyConstraint(['router_id'], ['routers.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('router_id'))
|
||||
|
||||
op.create_table(
|
||||
'ofcnetworks',
|
||||
sa.Column('id', sa.String(length=36), nullable=False),
|
||||
sa.Column('quantum_id', sa.String(length=36), nullable=False),
|
||||
sa.PrimaryKeyConstraint('id'))
|
||||
|
||||
op.create_table(
|
||||
'ofctenantmappings',
|
||||
sa.Column('ofc_id', sa.String(length=255), nullable=False),
|
||||
sa.Column('quantum_id', sa.String(length=36), nullable=False),
|
||||
sa.PrimaryKeyConstraint('quantum_id'),
|
||||
sa.UniqueConstraint('ofc_id'))
|
||||
|
||||
op.create_table(
|
||||
'ofcfiltermappings',
|
||||
sa.Column('ofc_id', sa.String(length=255), nullable=False),
|
||||
sa.Column('quantum_id', sa.String(length=36), nullable=False),
|
||||
sa.PrimaryKeyConstraint('quantum_id'),
|
||||
sa.UniqueConstraint('ofc_id'))
|
||||
|
||||
op.create_table(
|
||||
'ofcnetworkmappings',
|
||||
sa.Column('ofc_id', sa.String(length=255), nullable=False),
|
||||
sa.Column('quantum_id', sa.String(length=36), nullable=False),
|
||||
sa.PrimaryKeyConstraint('quantum_id'),
|
||||
sa.UniqueConstraint('ofc_id'))
|
||||
|
||||
op.create_table(
|
||||
'ofcfilters',
|
||||
sa.Column('id', sa.String(length=36), nullable=False),
|
||||
sa.Column('quantum_id', sa.String(length=36), nullable=False),
|
||||
sa.PrimaryKeyConstraint('id'))
|
||||
|
||||
op.create_table(
|
||||
'ofcports',
|
||||
sa.Column('id', sa.String(length=36), nullable=False),
|
||||
sa.Column('quantum_id', sa.String(length=36), nullable=False),
|
||||
sa.PrimaryKeyConstraint('id'))
|
||||
|
||||
op.create_table(
|
||||
'ofctenants',
|
||||
sa.Column('id', sa.String(length=36), nullable=False),
|
||||
sa.Column('quantum_id', sa.String(length=36), nullable=False),
|
||||
sa.PrimaryKeyConstraint('id'))
|
||||
|
||||
op.create_table(
|
||||
'packetfilters',
|
||||
sa.Column('tenant_id', sa.String(length=255), nullable=True),
|
||||
sa.Column('id', sa.String(length=36), nullable=False),
|
||||
sa.Column('name', sa.String(length=255), nullable=True),
|
||||
sa.Column('network_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('priority', sa.Integer(), nullable=False),
|
||||
sa.Column('action', sa.String(length=16), nullable=False),
|
||||
sa.Column('in_port', sa.String(length=36), nullable=True),
|
||||
sa.Column('src_mac', sa.String(length=32), nullable=False),
|
||||
sa.Column('dst_mac', sa.String(length=32), nullable=False),
|
||||
sa.Column('eth_type', sa.Integer(), nullable=False),
|
||||
sa.Column('src_cidr', sa.String(length=64), nullable=False),
|
||||
sa.Column('dst_cidr', sa.String(length=64), nullable=False),
|
||||
sa.Column('protocol', sa.String(length=16), nullable=False),
|
||||
sa.Column('src_port', sa.Integer(), nullable=False),
|
||||
sa.Column('dst_port', sa.Integer(), nullable=False),
|
||||
sa.Column('admin_state_up', sa.Boolean(), nullable=False),
|
||||
sa.Column('status', sa.String(length=16), nullable=False),
|
||||
sa.ForeignKeyConstraint(['network_id'], ['networks.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.ForeignKeyConstraint(['in_port'], ['ports.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('id'))
|
||||
|
||||
op.create_table(
|
||||
'portinfos',
|
||||
sa.Column('id', sa.String(length=36), nullable=False),
|
||||
sa.Column('datapath_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('port_no', sa.Integer(), nullable=False),
|
||||
sa.Column('vlan_id', sa.Integer(), nullable=False),
|
||||
sa.Column('mac', sa.String(length=32), nullable=False),
|
||||
sa.ForeignKeyConstraint(['id'], ['ports.id'], ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('id'))
|
||||
|
||||
|
||||
def downgrade():
|
||||
op.drop_table('portinfos')
|
||||
op.drop_table('packetfilters')
|
||||
op.drop_table('ofctenants')
|
||||
op.drop_table('ofcports')
|
||||
op.drop_table('ofcfilters')
|
||||
op.drop_table('ofcnetworkmappings')
|
||||
op.drop_table('ofcfiltermappings')
|
||||
op.drop_table('ofctenantmappings')
|
||||
op.drop_table('ofcnetworks')
|
||||
op.drop_table('routerproviders')
|
||||
op.drop_table('ofcroutermappings')
|
||||
op.drop_table('ofcportmappings')
|
@ -0,0 +1,94 @@
|
||||
# Copyright 2014 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
# Initial operations for extensions:
|
||||
# allowedaddresspairs
|
||||
# extradhcpopts
|
||||
# portbindings
|
||||
# quotas
|
||||
# routedserviceinsertion
|
||||
# servicetype
|
||||
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
def upgrade():
|
||||
op.create_table(
|
||||
'providerresourceassociations',
|
||||
sa.Column('provider_name', sa.String(length=255), nullable=False),
|
||||
sa.Column('resource_id', sa.String(length=36), nullable=False),
|
||||
sa.PrimaryKeyConstraint('provider_name', 'resource_id'),
|
||||
sa.UniqueConstraint('resource_id'))
|
||||
|
||||
op.create_table(
|
||||
'quotas',
|
||||
sa.Column('id', sa.String(length=36), nullable=False),
|
||||
sa.Column('tenant_id', sa.String(length=255), nullable=True),
|
||||
sa.Column('resource', sa.String(length=255), nullable=True),
|
||||
sa.Column('limit', sa.Integer(), nullable=True),
|
||||
sa.PrimaryKeyConstraint('id'))
|
||||
|
||||
op.create_table(
|
||||
'allowedaddresspairs',
|
||||
sa.Column('port_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('mac_address', sa.String(length=32), nullable=False),
|
||||
sa.Column('ip_address', sa.String(length=64), nullable=False),
|
||||
sa.ForeignKeyConstraint(['port_id'], ['ports.id'], ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('port_id', 'mac_address', 'ip_address'))
|
||||
|
||||
op.create_table(
|
||||
'portbindingports',
|
||||
sa.Column('port_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('host', sa.String(length=255), nullable=False),
|
||||
sa.ForeignKeyConstraint(['port_id'], ['ports.id'], ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('port_id'))
|
||||
|
||||
op.create_table(
|
||||
'extradhcpopts',
|
||||
sa.Column('id', sa.String(length=36), nullable=False),
|
||||
sa.Column('port_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('opt_name', sa.String(length=64), nullable=False),
|
||||
sa.Column('opt_value', sa.String(length=255), nullable=False),
|
||||
sa.ForeignKeyConstraint(['port_id'], ['ports.id'], ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('id'),
|
||||
sa.UniqueConstraint('port_id', 'opt_name', name='uidx_portid_optname'))
|
||||
|
||||
op.create_table(
|
||||
'routerservicetypebindings',
|
||||
sa.Column('router_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('service_type_id', sa.String(length=36), nullable=False),
|
||||
sa.ForeignKeyConstraint(['router_id'], ['routers.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('router_id'))
|
||||
|
||||
op.create_table(
|
||||
'servicerouterbindings',
|
||||
sa.Column('resource_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('resource_type', sa.String(length=36), nullable=False),
|
||||
sa.Column('router_id', sa.String(length=36), nullable=False),
|
||||
sa.ForeignKeyConstraint(['router_id'], ['routers.id'], ),
|
||||
sa.PrimaryKeyConstraint('resource_id', 'resource_type'))
|
||||
|
||||
|
||||
def downgrade():
|
||||
op.drop_table('servicerouterbindings')
|
||||
op.drop_table('routerservicetypebindings')
|
||||
op.drop_table('extradhcpopts')
|
||||
op.drop_table('portbindingports')
|
||||
op.drop_table('allowedaddresspairs')
|
||||
op.drop_table('quotas')
|
||||
op.drop_table('providerresourceassociations')
|
@ -0,0 +1,90 @@
|
||||
# Copyright 2014 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
# Initial operations for plugins:
|
||||
# hyper-v
|
||||
# bigswitch
|
||||
# metaplugin
|
||||
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
def upgrade():
|
||||
# hyper-v
|
||||
op.create_table(
|
||||
'hyperv_vlan_allocations',
|
||||
sa.Column('physical_network', sa.String(length=64), nullable=False),
|
||||
sa.Column('vlan_id', sa.Integer(), autoincrement=False,
|
||||
nullable=False),
|
||||
sa.Column('allocated', sa.Boolean(), nullable=False),
|
||||
sa.PrimaryKeyConstraint('physical_network', 'vlan_id'))
|
||||
|
||||
op.create_table(
|
||||
'hyperv_network_bindings',
|
||||
sa.Column('network_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('network_type', sa.String(length=32), nullable=False),
|
||||
sa.Column('physical_network', sa.String(length=64), nullable=True),
|
||||
sa.Column('segmentation_id', sa.Integer(), nullable=True),
|
||||
sa.ForeignKeyConstraint(['network_id'], ['networks.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('network_id'))
|
||||
|
||||
# metaplugin
|
||||
op.create_table(
|
||||
'networkflavors',
|
||||
sa.Column('flavor', sa.String(length=255), nullable=True),
|
||||
sa.Column('network_id', sa.String(length=36), nullable=False),
|
||||
sa.ForeignKeyConstraint(['network_id'], ['networks.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('network_id'))
|
||||
|
||||
op.create_table(
|
||||
'routerflavors',
|
||||
sa.Column('flavor', sa.String(length=255), nullable=True),
|
||||
sa.Column('router_id', sa.String(length=36), nullable=False),
|
||||
sa.ForeignKeyConstraint(['router_id'], ['routers.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('router_id'))
|
||||
|
||||
# big switch
|
||||
op.create_table(
|
||||
'routerrules',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('source', sa.String(length=64), nullable=False),
|
||||
sa.Column('destination', sa.String(length=64), nullable=False),
|
||||
sa.Column('action', sa.String(length=10), nullable=False),
|
||||
sa.Column('router_id', sa.String(length=36), nullable=True),
|
||||
sa.ForeignKeyConstraint(['router_id'], ['routers.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('id'))
|
||||
|
||||
op.create_table(
|
||||
'nexthops',
|
||||
sa.Column('rule_id', sa.Integer(), nullable=False),
|
||||
sa.Column('nexthop', sa.String(length=64), nullable=False),
|
||||
sa.ForeignKeyConstraint(['rule_id'], ['routerrules.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('rule_id', 'nexthop'))
|
||||
|
||||
|
||||
def downgrade():
|
||||
op.drop_table('nexthops')
|
||||
op.drop_table('routerrules')
|
||||
op.drop_table('routerflavors')
|
||||
op.drop_table('networkflavors')
|
||||
op.drop_table('hyperv_network_bindings')
|
||||
op.drop_table('hyperv_vlan_allocations')
|
61
neutron/db/migration/alembic_migrations/ovs_init_ops.py
Normal file
61
neutron/db/migration/alembic_migrations/ovs_init_ops.py
Normal file
@ -0,0 +1,61 @@
|
||||
# Copyright 2014 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
# Initial operations for the OVS plugin
|
||||
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
def upgrade():
|
||||
op.create_table(
|
||||
'ovs_tunnel_endpoints',
|
||||
sa.Column('ip_address', sa.String(length=64), nullable=False),
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.PrimaryKeyConstraint('ip_address'),
|
||||
sa.UniqueConstraint('id', name='uniq_ovs_tunnel_endpoints0id'))
|
||||
|
||||
op.create_table(
|
||||
'ovs_tunnel_allocations',
|
||||
sa.Column('tunnel_id', sa.Integer(), autoincrement=False,
|
||||
nullable=False),
|
||||
sa.Column('allocated', sa.Boolean(), nullable=False),
|
||||
sa.PrimaryKeyConstraint('tunnel_id'))
|
||||
|
||||
op.create_table(
|
||||
'ovs_vlan_allocations',
|
||||
sa.Column('physical_network', sa.String(length=64), nullable=False),
|
||||
sa.Column('vlan_id', sa.Integer(), autoincrement=False,
|
||||
nullable=False),
|
||||
sa.Column('allocated', sa.Boolean(), nullable=False),
|
||||
sa.PrimaryKeyConstraint('physical_network', 'vlan_id'))
|
||||
|
||||
op.create_table(
|
||||
'ovs_network_bindings',
|
||||
sa.Column('network_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('network_type', sa.String(length=32), nullable=False),
|
||||
sa.Column('physical_network', sa.String(length=64), nullable=True),
|
||||
sa.Column('segmentation_id', sa.Integer(), nullable=True),
|
||||
sa.ForeignKeyConstraint(['network_id'], ['networks.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('network_id'))
|
||||
|
||||
|
||||
def downgrade():
|
||||
op.drop_table('ovs_network_bindings')
|
||||
op.drop_table('ovs_vlan_allocations')
|
||||
op.drop_table('ovs_tunnel_allocations')
|
||||
op.drop_table('ovs_tunnel_endpoints')
|
43
neutron/db/migration/alembic_migrations/portsec_init_ops.py
Normal file
43
neutron/db/migration/alembic_migrations/portsec_init_ops.py
Normal file
@ -0,0 +1,43 @@
|
||||
# Copyright 2014 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
# Initial operations for the port security extension
|
||||
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
def upgrade():
|
||||
op.create_table(
|
||||
'networksecuritybindings',
|
||||
sa.Column('network_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('port_security_enabled', sa.Boolean(), nullable=False),
|
||||
sa.ForeignKeyConstraint(['network_id'], ['networks.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('network_id'))
|
||||
|
||||
op.create_table(
|
||||
'portsecuritybindings',
|
||||
sa.Column('port_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('port_security_enabled', sa.Boolean(), nullable=False),
|
||||
sa.ForeignKeyConstraint(['port_id'], ['ports.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('port_id'))
|
||||
|
||||
|
||||
def downgrade():
|
||||
op.drop_table('portsecuritybindings')
|
||||
op.drop_table('networksecuritybindings')
|
40
neutron/db/migration/alembic_migrations/ryu_init_ops.py
Normal file
40
neutron/db/migration/alembic_migrations/ryu_init_ops.py
Normal file
@ -0,0 +1,40 @@
|
||||
# Copyright 2014 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
# Initial operations for the Ryu plugin
|
||||
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
def upgrade():
|
||||
op.create_table(
|
||||
'tunnelkeylasts',
|
||||
sa.Column('last_key', sa.Integer(), nullable=False),
|
||||
sa.PrimaryKeyConstraint('last_key'))
|
||||
|
||||
op.create_table(
|
||||
'tunnelkeys',
|
||||
sa.Column('network_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('tunnel_key', sa.Integer(), autoincrement=False,
|
||||
nullable=False),
|
||||
sa.ForeignKeyConstraint(['network_id'], ['networks.id'], ),
|
||||
sa.PrimaryKeyConstraint('tunnel_key'))
|
||||
|
||||
|
||||
def downgrade():
|
||||
op.drop_table('tunnelkeys')
|
||||
op.drop_table('tunnelkeylasts')
|
@ -13,53 +13,31 @@
|
||||
# under the License.
|
||||
#
|
||||
|
||||
"""bsn_security_groups
|
||||
|
||||
Revision ID: f44ab9871cd6
|
||||
Revises: e766b19a3bb
|
||||
Create Date: 2014-02-26 17:43:43.051078
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'f44ab9871cd6'
|
||||
down_revision = 'e766b19a3bb'
|
||||
|
||||
# Change to ['*'] if this migration applies to all plugins
|
||||
|
||||
migration_for_plugins = [
|
||||
'neutron.plugins.bigswitch.plugin.NeutronRestProxyV2',
|
||||
]
|
||||
|
||||
# Initial operations for security group extension
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
from neutron.db import migration
|
||||
|
||||
securitygrouprules_direction = sa.Enum('ingress', 'egress',
|
||||
name='securitygrouprules_direction')
|
||||
rule_direction_enum = sa.Enum('ingress', 'egress',
|
||||
name='securitygrouprules_direction')
|
||||
|
||||
|
||||
def upgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
def upgrade():
|
||||
op.create_table(
|
||||
'securitygroups',
|
||||
sa.Column('tenant_id', sa.String(length=255), nullable=True),
|
||||
sa.Column('id', sa.String(length=36), nullable=False),
|
||||
sa.Column('name', sa.String(length=255), nullable=True),
|
||||
sa.Column('description', sa.String(length=255), nullable=True),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
sa.PrimaryKeyConstraint('id'))
|
||||
|
||||
op.create_table(
|
||||
'securitygrouprules',
|
||||
sa.Column('tenant_id', sa.String(length=255), nullable=True),
|
||||
sa.Column('id', sa.String(length=36), nullable=False),
|
||||
sa.Column('security_group_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('remote_group_id', sa.String(length=36), nullable=True),
|
||||
sa.Column('direction', securitygrouprules_direction, nullable=True),
|
||||
sa.Column('direction', rule_direction_enum, nullable=True),
|
||||
sa.Column('ethertype', sa.String(length=40), nullable=True),
|
||||
sa.Column('protocol', sa.String(length=40), nullable=True),
|
||||
sa.Column('port_range_min', sa.Integer(), nullable=True),
|
||||
@ -69,18 +47,19 @@ def upgrade(active_plugins=None, options=None):
|
||||
ondelete='CASCADE'),
|
||||
sa.ForeignKeyConstraint(['remote_group_id'], ['securitygroups.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
sa.PrimaryKeyConstraint('id'))
|
||||
|
||||
op.create_table(
|
||||
'securitygroupportbindings',
|
||||
sa.Column('port_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('security_group_id', sa.String(length=36), nullable=False),
|
||||
sa.ForeignKeyConstraint(['port_id'], ['ports.id'], ondelete='CASCADE'),
|
||||
sa.ForeignKeyConstraint(['security_group_id'], ['securitygroups.id']),
|
||||
sa.PrimaryKeyConstraint('port_id', 'security_group_id')
|
||||
)
|
||||
### end Alembic commands ###
|
||||
sa.PrimaryKeyConstraint('port_id', 'security_group_id'))
|
||||
|
||||
|
||||
def downgrade(active_plugins=None, options=None):
|
||||
pass
|
||||
def downgrade():
|
||||
op.drop_table('securitygroupportbindings')
|
||||
op.drop_table('securitygrouprules')
|
||||
op.drop_table('securitygroups')
|
||||
rule_direction_enum.drop(op.get_bind(), checkfirst=False)
|
@ -1,61 +0,0 @@
|
||||
# Copyright 2013 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
"""nec-pf-port-del
|
||||
|
||||
Revision ID: 1064e98b7917
|
||||
Revises: 3d6fae8b70b0
|
||||
Create Date: 2013-09-24 05:33:54.602618
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '1064e98b7917'
|
||||
down_revision = '3d6fae8b70b0'
|
||||
|
||||
# Change to ['*'] if this migration applies to all plugins
|
||||
|
||||
migration_for_plugins = [
|
||||
'neutron.plugins.nec.nec_plugin.NECPluginV2'
|
||||
]
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
from neutron.db import migration
|
||||
|
||||
|
||||
def upgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.alter_column('packetfilters', 'in_port',
|
||||
existing_type=sa.String(length=36),
|
||||
nullable=True)
|
||||
op.create_foreign_key(
|
||||
'packetfilters_ibfk_2',
|
||||
source='packetfilters', referent='ports',
|
||||
local_cols=['in_port'], remote_cols=['id'],
|
||||
ondelete='CASCADE')
|
||||
|
||||
|
||||
def downgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.drop_constraint('packetfilters_ibfk_2', 'packetfilters', 'foreignkey')
|
||||
op.alter_column('packetfilters', 'in_port',
|
||||
existing_type=sa.String(length=36),
|
||||
nullable=False)
|
@ -1,82 +0,0 @@
|
||||
# Copyright 2013 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
"""initial port security
|
||||
|
||||
Revision ID: 1149d7de0cfa
|
||||
Revises: 1b693c095aa3
|
||||
Create Date: 2013-01-22 14:05:20.696502
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '1149d7de0cfa'
|
||||
down_revision = '1b693c095aa3'
|
||||
|
||||
# Change to ['*'] if this migration applies to all plugins
|
||||
|
||||
migration_for_plugins = [
|
||||
'neutron.plugins.nicira.NeutronPlugin.NvpPluginV2',
|
||||
'neutron.plugins.nicira.NeutronServicePlugin.NvpAdvancedPlugin',
|
||||
'neutron.plugins.vmware.plugin.NsxPlugin',
|
||||
'neutron.plugins.vmware.plugin.NsxServicePlugin'
|
||||
]
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
from neutron.db import migration
|
||||
|
||||
|
||||
def upgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table('networksecuritybindings',
|
||||
sa.Column('network_id', sa.String(length=36),
|
||||
nullable=False),
|
||||
sa.Column('port_security_enabled', sa.Boolean(),
|
||||
nullable=False),
|
||||
sa.ForeignKeyConstraint(['network_id'], ['networks.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('network_id'))
|
||||
op.create_table('portsecuritybindings',
|
||||
sa.Column('port_id', sa.String(length=36),
|
||||
nullable=False),
|
||||
sa.Column('port_security_enabled', sa.Boolean(),
|
||||
nullable=False),
|
||||
sa.ForeignKeyConstraint(['port_id'], ['ports.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('port_id'))
|
||||
### end Alembic commands ###
|
||||
|
||||
# Copy network and port ids over to network|port(securitybindings) table
|
||||
# and set port_security_enabled to false as ip address pairs were not
|
||||
# configured in NVP/NSX originally.
|
||||
op.execute("INSERT INTO networksecuritybindings SELECT id as "
|
||||
"network_id, False as port_security_enabled from networks")
|
||||
op.execute("INSERT INTO portsecuritybindings SELECT id as port_id, "
|
||||
"False as port_security_enabled from ports")
|
||||
|
||||
|
||||
def downgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_table('portsecuritybindings')
|
||||
op.drop_table('networksecuritybindings')
|
||||
### end Alembic commands ###
|
@ -1,60 +0,0 @@
|
||||
# Copyright 2013 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
"""Pool Monitor status field
|
||||
|
||||
Revision ID: 11c6e18605c8
|
||||
Revises: 52ff27f7567a
|
||||
Create Date: 2013-07-10 06:07:20.878520
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '11c6e18605c8'
|
||||
down_revision = '52ff27f7567a'
|
||||
|
||||
# Change to ['*'] if this migration applies to all plugins
|
||||
|
||||
migration_for_plugins = [
|
||||
'neutron.services.loadbalancer.plugin.LoadBalancerPlugin',
|
||||
]
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
from neutron.db import migration
|
||||
|
||||
|
||||
def upgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.add_column('poolmonitorassociations', sa.Column('status',
|
||||
sa.String(16),
|
||||
server_default='',
|
||||
nullable=False))
|
||||
op.add_column('poolmonitorassociations', sa.Column('status_description',
|
||||
sa.String(255)))
|
||||
|
||||
# Set status to ACTIVE for existing associations
|
||||
op.execute("UPDATE poolmonitorassociations SET status='ACTIVE'")
|
||||
|
||||
|
||||
def downgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.drop_column('poolmonitorassociations', 'status')
|
||||
op.drop_column('poolmonitorassociations', 'status_description')
|
@ -1,69 +0,0 @@
|
||||
# Copyright 2013 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
"""ext_gw_mode
|
||||
|
||||
Revision ID: 128e042a2b68
|
||||
Revises: 32b517556ec9
|
||||
Create Date: 2013-03-27 00:35:17.323280
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '128e042a2b68'
|
||||
down_revision = '32b517556ec9'
|
||||
|
||||
# Change to ['*'] if this migration applies to all plugins
|
||||
|
||||
migration_for_plugins = [
|
||||
'neutron.plugins.hyperv.hyperv_neutron_plugin.HyperVNeutronPlugin',
|
||||
'neutron.plugins.linuxbridge.lb_neutron_plugin.LinuxBridgePluginV2',
|
||||
'neutron.plugins.metaplugin.meta_neutron_plugin.MetaPluginV2',
|
||||
'neutron.plugins.ml2.plugin.Ml2Plugin',
|
||||
'neutron.plugins.nec.nec_plugin.NECPluginV2',
|
||||
'neutron.plugins.nicira.NeutronPlugin.NvpPluginV2',
|
||||
'neutron.plugins.nicira.NeutronServicePlugin.NvpAdvancedPlugin',
|
||||
'neutron.plugins.openvswitch.ovs_neutron_plugin.OVSNeutronPluginV2',
|
||||
'neutron.plugins.ryu.ryu_neutron_plugin.RyuNeutronPluginV2',
|
||||
'neutron.plugins.vmware.plugin.NsxPlugin',
|
||||
'neutron.plugins.vmware.plugin.NsxServicePlugin',
|
||||
'neutron.plugins.embrane.plugins.embrane_ovs_plugin.EmbraneOvsPlugin',
|
||||
'neutron.plugins.ibm.sdnve_neutron_plugin.SdnvePluginV2',
|
||||
'neutron.plugins.oneconvergence.plugin.OneConvergencePluginV2',
|
||||
'neutron.plugins.cisco.network_plugin.PluginV2',
|
||||
]
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
from neutron.db import migration
|
||||
|
||||
|
||||
def upgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.add_column('routers', sa.Column('enable_snat', sa.Boolean(),
|
||||
nullable=False, server_default="1"))
|
||||
# Set enable_snat to True for existing routers
|
||||
op.execute("UPDATE routers SET enable_snat=True")
|
||||
|
||||
|
||||
def downgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.drop_column('routers', 'enable_snat')
|
@ -1,68 +0,0 @@
|
||||
# Copyright 2013 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
"""nvp_net_binding
|
||||
|
||||
Revision ID: 1341ed32cc1e
|
||||
Revises: 4692d074d587
|
||||
Create Date: 2013-02-26 01:28:29.182195
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '1341ed32cc1e'
|
||||
down_revision = '4692d074d587'
|
||||
|
||||
# Change to ['*'] if this migration applies to all plugins
|
||||
|
||||
migration_for_plugins = [
|
||||
'neutron.plugins.nicira.NeutronPlugin.NvpPluginV2',
|
||||
'neutron.plugins.nicira.NeutronServicePlugin.NvpAdvancedPlugin',
|
||||
'neutron.plugins.vmware.plugin.NsxPlugin',
|
||||
'neutron.plugins.vmware.plugin.NsxServicePlugin'
|
||||
]
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
from neutron.db import migration
|
||||
|
||||
new_type = sa.Enum('flat', 'vlan', 'stt', 'gre', 'l3_ext',
|
||||
name='nvp_network_bindings_binding_type')
|
||||
old_type = sa.Enum('flat', 'vlan', 'stt', 'gre',
|
||||
name='nvp_network_bindings_binding_type')
|
||||
|
||||
|
||||
def upgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
op.alter_column('nvp_network_bindings', 'tz_uuid',
|
||||
name='phy_uuid',
|
||||
existing_type=sa.String(36),
|
||||
existing_nullable=True)
|
||||
migration.alter_enum('nvp_network_bindings', 'binding_type', new_type,
|
||||
nullable=False)
|
||||
|
||||
|
||||
def downgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
op.alter_column('nvp_network_bindings', 'phy_uuid',
|
||||
name='tz_uuid',
|
||||
existing_type=sa.String(36),
|
||||
existing_nullable=True)
|
||||
migration.alter_enum('nvp_network_bindings', 'binding_type', old_type,
|
||||
nullable=False)
|
@ -1,53 +0,0 @@
|
||||
# Copyright 2013 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
"""nec_add_pf_name
|
||||
|
||||
Revision ID: 13de305df56e
|
||||
Revises: b7a8863760e
|
||||
Create Date: 2013-07-06 00:42:26.991175
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '13de305df56e'
|
||||
down_revision = 'b7a8863760e'
|
||||
|
||||
# Change to ['*'] if this migration applies to all plugins
|
||||
|
||||
migration_for_plugins = [
|
||||
'neutron.plugins.nec.nec_plugin.NECPluginV2'
|
||||
]
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
from neutron.db import migration
|
||||
|
||||
|
||||
def upgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.add_column('packetfilters',
|
||||
sa.Column('name', sa.String(length=255), nullable=True))
|
||||
|
||||
|
||||
def downgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.drop_column('packetfilters', 'name')
|
@ -18,13 +18,13 @@
|
||||
"""NSX DHCP/metadata support
|
||||
|
||||
Revision ID: 1421183d533f
|
||||
Revises: 8f682276ee4
|
||||
Revises: 50e86cb2637a
|
||||
Create Date: 2013-10-11 14:33:37.303215
|
||||
|
||||
"""
|
||||
|
||||
revision = '1421183d533f'
|
||||
down_revision = '8f682276ee4'
|
||||
down_revision = '50e86cb2637a'
|
||||
|
||||
migration_for_plugins = [
|
||||
'neutron.plugins.nicira.NeutronPlugin.NvpPluginV2',
|
||||
|
@ -1,76 +0,0 @@
|
||||
# Copyright 2013 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
"""DB Migration for Arista ml2 mechanism driver
|
||||
|
||||
Revision ID: 14f24494ca31
|
||||
Revises: 2a3bae1ceb8
|
||||
Create Date: 2013-08-15 18:54:16.083640
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '14f24494ca31'
|
||||
down_revision = '2a3bae1ceb8'
|
||||
|
||||
# Change to ['*'] if this migration applies to all plugins
|
||||
|
||||
migration_for_plugins = [
|
||||
'neutron.plugins.ml2.plugin.Ml2Plugin'
|
||||
]
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
from neutron.db import migration
|
||||
|
||||
|
||||
def upgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.create_table(
|
||||
'arista_provisioned_nets',
|
||||
sa.Column('tenant_id', sa.String(length=255), nullable=True),
|
||||
sa.Column('id', sa.String(length=36), nullable=False),
|
||||
sa.Column('network_id', sa.String(length=36), nullable=True),
|
||||
sa.Column('segmentation_id', sa.Integer(),
|
||||
autoincrement=False, nullable=True),
|
||||
sa.PrimaryKeyConstraint('id'))
|
||||
|
||||
op.create_table(
|
||||
'arista_provisioned_vms',
|
||||
sa.Column('tenant_id', sa.String(length=255), nullable=True),
|
||||
sa.Column('id', sa.String(length=36), nullable=False),
|
||||
sa.Column('vm_id', sa.String(length=255), nullable=True),
|
||||
sa.Column('host_id', sa.String(length=255), nullable=True),
|
||||
sa.Column('port_id', sa.String(length=36), nullable=True),
|
||||
sa.Column('network_id', sa.String(length=36), nullable=True),
|
||||
sa.PrimaryKeyConstraint('id'))
|
||||
|
||||
op.create_table(
|
||||
'arista_provisioned_tenants',
|
||||
sa.Column('tenant_id', sa.String(length=255), nullable=True),
|
||||
sa.Column('id', sa.String(length=36), nullable=False),
|
||||
sa.PrimaryKeyConstraint('id'))
|
||||
|
||||
|
||||
def downgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.drop_table('arista_provisioned_tenants')
|
||||
op.drop_table('arista_provisioned_vms')
|
||||
op.drop_table('arista_provisioned_nets')
|
@ -1,64 +0,0 @@
|
||||
# Copyright 2013 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
"""Add portbindings db
|
||||
|
||||
Revision ID: 176a85fc7d79
|
||||
Revises: f489cf14a79c
|
||||
Create Date: 2013-03-21 14:59:53.052600
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '176a85fc7d79'
|
||||
down_revision = 'f489cf14a79c'
|
||||
|
||||
# Change to ['*'] if this migration applies to all plugins
|
||||
|
||||
migration_for_plugins = [
|
||||
'neutron.plugins.bigswitch.plugin.NeutronRestProxyV2',
|
||||
'neutron.plugins.linuxbridge.lb_neutron_plugin.LinuxBridgePluginV2',
|
||||
'neutron.plugins.openvswitch.ovs_neutron_plugin.OVSNeutronPluginV2',
|
||||
'neutron.plugins.nicira.NeutronPlugin.NvpPluginV2',
|
||||
'neutron.plugins.nicira.NeutronServicePlugin.NvpAdvancedPlugin',
|
||||
'neutron.plugins.vmware.plugin.NsxPlugin',
|
||||
'neutron.plugins.vmware.plugin.NsxServicePlugin',
|
||||
'neutron.plugins.ibm.sdnve_neutron_plugin.SdnvePluginV2',
|
||||
'neutron.plugins.oneconvergence.plugin.OneConvergencePluginV2',
|
||||
]
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
from neutron.db import migration
|
||||
|
||||
|
||||
def upgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.create_table(
|
||||
'portbindingports',
|
||||
sa.Column('port_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('host', sa.String(length=255), nullable=False),
|
||||
sa.ForeignKeyConstraint(['port_id'], ['ports.id'], ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('port_id')
|
||||
)
|
||||
|
||||
|
||||
def downgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
op.drop_table('portbindingports')
|
@ -1,62 +0,0 @@
|
||||
# Copyright 2013 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
"""Quota ext support added in Grizzly
|
||||
|
||||
Revision ID: 1b693c095aa3
|
||||
Revises: 1d76643bcec4
|
||||
Create Date: 2013-01-19 02:58:17.667524
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '1b693c095aa3'
|
||||
down_revision = '2a6d0b51f4bb'
|
||||
|
||||
# Change to ['*'] if this migration applies to all plugins
|
||||
|
||||
migration_for_plugins = [
|
||||
'neutron.plugins.nec.nec_plugin.NECPluginV2'
|
||||
]
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
from neutron.db import migration
|
||||
|
||||
|
||||
def upgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table(
|
||||
'quotas',
|
||||
sa.Column('id', sa.String(length=36), nullable=False),
|
||||
sa.Column('tenant_id', sa.String(length=255), nullable=True),
|
||||
sa.Column('resource', sa.String(length=255), nullable=True),
|
||||
sa.Column('limit', sa.Integer(), nullable=True),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_table('quotas')
|
||||
### end Alembic commands ###
|
@ -1,80 +0,0 @@
|
||||
# Copyright 2013 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
"""Support routing table configuration on Router
|
||||
|
||||
Revision ID: 1c33fa3cd1a1
|
||||
Revises: 45680af419f9
|
||||
Create Date: 2013-01-17 14:35:09.386975
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '1c33fa3cd1a1'
|
||||
down_revision = '45680af419f9'
|
||||
|
||||
# Change to ['*'] if this migration applies to all plugins
|
||||
|
||||
migration_for_plugins = [
|
||||
'neutron.plugins.openvswitch.ovs_neutron_plugin.OVSNeutronPluginV2',
|
||||
'neutron.plugins.linuxbridge.lb_neutron_plugin.LinuxBridgePluginV2',
|
||||
'neutron.plugins.metaplugin.meta_neutron_plugin.MetaPluginV2',
|
||||
'neutron.plugins.ml2.plugin.Ml2Plugin',
|
||||
'neutron.plugins.nec.nec_plugin.NECPluginV2',
|
||||
'neutron.plugins.nicira.NeutronPlugin.NvpPluginV2',
|
||||
'neutron.plugins.nicira.NeutronServicePlugin.NvpAdvancedPlugin',
|
||||
'neutron.plugins.ryu.ryu_neutron_plugin.RyuNeutronPluginV2',
|
||||
'neutron.plugins.vmware.plugin.NsxPlugin',
|
||||
'neutron.plugins.vmware.plugin.NsxServicePlugin',
|
||||
'neutron.plugins.oneconvergence.plugin.OneConvergencePluginV2',
|
||||
'neutron.plugins.cisco.network_plugin.PluginV2',
|
||||
'neutron.plugins.bigswitch.plugin.NeutronRestProxyV2'
|
||||
]
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
from neutron.db import migration
|
||||
|
||||
|
||||
def upgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.rename_table(
|
||||
'routes',
|
||||
'subnetroutes',
|
||||
)
|
||||
op.create_table(
|
||||
'routerroutes',
|
||||
sa.Column('destination', sa.String(length=64), nullable=False),
|
||||
sa.Column(
|
||||
'nexthop', sa.String(length=64), nullable=False),
|
||||
sa.Column('router_id', sa.String(length=36), nullable=False),
|
||||
sa.ForeignKeyConstraint(
|
||||
['router_id'], ['routers.id'], ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('destination', 'nexthop', 'router_id')
|
||||
)
|
||||
|
||||
|
||||
def downgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.rename_table(
|
||||
'subnetroutes',
|
||||
'routes',
|
||||
)
|
||||
op.drop_table('routerroutes')
|
@ -1,67 +0,0 @@
|
||||
# Copyright 2013 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
"""nvp_netbinding
|
||||
|
||||
Revision ID: 1d76643bcec4
|
||||
Revises: 3cb5d900c5de
|
||||
Create Date: 2013-01-15 07:36:10.024346
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '1d76643bcec4'
|
||||
down_revision = '3cb5d900c5de'
|
||||
|
||||
# Change to ['*'] if this migration applies to all plugins
|
||||
|
||||
migration_for_plugins = [
|
||||
'neutron.plugins.nicira.NeutronPlugin.NvpPluginV2',
|
||||
'neutron.plugins.nicira.NeutronServicePlugin.NvpAdvancedPlugin',
|
||||
'neutron.plugins.vmware.plugin.NsxPlugin',
|
||||
'neutron.plugins.vmware.plugin.NsxServicePlugin'
|
||||
]
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
from neutron.db import migration
|
||||
|
||||
nvp_network_bindings_binding_type = sa.Enum(
|
||||
'flat', 'vlan', 'stt', 'gre', name='nvp_network_bindings_binding_type')
|
||||
|
||||
|
||||
def upgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.create_table(
|
||||
'nvp_network_bindings',
|
||||
sa.Column('network_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('binding_type', nvp_network_bindings_binding_type,
|
||||
nullable=False),
|
||||
sa.Column('tz_uuid', sa.String(length=36), nullable=True),
|
||||
sa.Column('vlan_id', sa.Integer(), nullable=True),
|
||||
sa.ForeignKeyConstraint(['network_id'], ['networks.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('network_id'))
|
||||
|
||||
|
||||
def downgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.drop_table('nvp_network_bindings')
|
||||
nvp_network_bindings_binding_type.drop(op.get_bind(), checkfirst=False)
|
@ -1,65 +0,0 @@
|
||||
# Copyright 2013 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
"""allowedaddresspairs
|
||||
|
||||
Revision ID: 1efb85914233
|
||||
Revises: 51b4de912379
|
||||
Create Date: 2013-07-23 12:56:00.402855
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '1efb85914233'
|
||||
down_revision = '51b4de912379'
|
||||
|
||||
# Change to ['*'] if this migration applies to all plugins
|
||||
|
||||
migration_for_plugins = [
|
||||
'neutron.plugins.cisco.network_plugin.PluginV2',
|
||||
'neutron.plugins.nicira.NeutronPlugin.NvpPluginV2',
|
||||
'neutron.plugins.nicira.NeutronServicePlugin.NvpAdvancedPlugin',
|
||||
'neutron.plugins.ml2.plugin.Ml2Plugin',
|
||||
'neutron.plugins.nec.nec_plugin.NECPluginV2',
|
||||
'neutron.plugins.openvswitch.ovs_neutron_plugin.OVSNeutronPluginV2',
|
||||
'neutron.plugins.vmware.plugin.NsxPlugin',
|
||||
'neutron.plugins.vmware.plugin.NsxServicePlugin',
|
||||
]
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
from neutron.db import migration
|
||||
|
||||
|
||||
def upgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.create_table(
|
||||
'allowedaddresspairs',
|
||||
sa.Column('port_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('mac_address', sa.String(length=32), nullable=False),
|
||||
sa.Column('ip_address', sa.String(length=64), nullable=False),
|
||||
sa.ForeignKeyConstraint(['port_id'], ['ports.id'], ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('port_id', 'mac_address', 'ip_address'),
|
||||
)
|
||||
|
||||
|
||||
def downgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.drop_table('allowedaddresspairs')
|
@ -1,55 +0,0 @@
|
||||
# Copyright 2013 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
"""LBaaS add status description
|
||||
|
||||
Revision ID: 2032abe8edac
|
||||
Revises: 477a4488d3f4
|
||||
Create Date: 2013-06-24 06:51:47.308545
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '2032abe8edac'
|
||||
down_revision = '477a4488d3f4'
|
||||
|
||||
# Change to ['*'] if this migration applies to all plugins
|
||||
|
||||
migration_for_plugins = [
|
||||
'neutron.services.loadbalancer.plugin.LoadBalancerPlugin',
|
||||
]
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
from neutron.db import migration
|
||||
|
||||
ENTITIES = ['vips', 'pools', 'members', 'healthmonitors']
|
||||
|
||||
|
||||
def upgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
for entity in ENTITIES:
|
||||
op.add_column(entity, sa.Column('status_description', sa.String(255)))
|
||||
|
||||
|
||||
def downgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
for entity in ENTITIES:
|
||||
op.drop_column(entity, 'status_description')
|
@ -1,64 +0,0 @@
|
||||
# Copyright 2013 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
"""DB Migration for ML2 GRE Type Driver
|
||||
|
||||
Revision ID: 20ae61555e95
|
||||
Revises: 13de305df56e
|
||||
Create Date: 2013-07-10 17:19:03.021937
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '20ae61555e95'
|
||||
down_revision = '13de305df56e'
|
||||
|
||||
# Change to ['*'] if this migration applies to all plugins
|
||||
|
||||
migration_for_plugins = [
|
||||
'neutron.plugins.ml2.plugin.Ml2Plugin'
|
||||
]
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
from neutron.db import migration
|
||||
|
||||
|
||||
def upgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.create_table(
|
||||
'ml2_gre_allocations',
|
||||
sa.Column('gre_id', sa.Integer, nullable=False,
|
||||
autoincrement=False),
|
||||
sa.Column('allocated', sa.Boolean, nullable=False),
|
||||
sa.PrimaryKeyConstraint('gre_id')
|
||||
)
|
||||
|
||||
op.create_table(
|
||||
'ml2_gre_endpoints',
|
||||
sa.Column('ip_address', sa.String(length=64)),
|
||||
sa.PrimaryKeyConstraint('ip_address')
|
||||
)
|
||||
|
||||
|
||||
def downgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.drop_table('ml2_gre_allocations')
|
||||
op.drop_table('ml2_gre_endpoints')
|
@ -1,59 +0,0 @@
|
||||
# Copyright 2013 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
"""NEC PacketFilter network_id nullable fix
|
||||
|
||||
Revision ID: 2528ceb28230
|
||||
Revises: 1064e98b7917
|
||||
Create Date: 2013-09-24 12:07:43.124256
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '2528ceb28230'
|
||||
down_revision = '1064e98b7917'
|
||||
|
||||
# Change to ['*'] if this migration applies to all plugins
|
||||
|
||||
migration_for_plugins = [
|
||||
'neutron.plugins.nec.nec_plugin.NECPluginV2'
|
||||
]
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
from neutron.db import migration
|
||||
|
||||
|
||||
def upgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.alter_column('packetfilters', 'network_id',
|
||||
existing_type=sa.String(length=36),
|
||||
nullable=False)
|
||||
|
||||
|
||||
def downgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
# NOTE(amotoki): There is a bug that nullable of network_id is
|
||||
# set to True by mistake in folsom_initial (bug 1229508).
|
||||
# To make sure nullable=False in any revision, nullable is set
|
||||
# to False in both upgrade and downgrade.
|
||||
op.alter_column('packetfilters', 'network_id',
|
||||
existing_type=sa.String(length=36),
|
||||
nullable=False)
|
@ -1,64 +0,0 @@
|
||||
# Copyright 2013 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
"""Cisco plugin db cleanup part II
|
||||
|
||||
Revision ID: 263772d65691
|
||||
Revises: 35c7c198ddea
|
||||
Create Date: 2013-07-29 02:31:26.646343
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '263772d65691'
|
||||
down_revision = '35c7c198ddea'
|
||||
|
||||
# Change to ['*'] if this migration applies to all plugins
|
||||
|
||||
migration_for_plugins = [
|
||||
'neutron.plugins.cisco.network_plugin.PluginV2'
|
||||
]
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
from neutron.db import migration
|
||||
|
||||
|
||||
def upgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.rename_table('credentials', 'cisco_credentials')
|
||||
op.rename_table('nexusport_bindings', 'cisco_nexusport_bindings')
|
||||
op.rename_table('qoss', 'cisco_qos_policies')
|
||||
|
||||
op.drop_table('cisco_vlan_ids')
|
||||
|
||||
|
||||
def downgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.create_table(
|
||||
'cisco_vlan_ids',
|
||||
sa.Column('vlan_id', sa.Integer, nullable=False),
|
||||
sa.Column('vlan_used', sa.Boolean),
|
||||
sa.PrimaryKeyConstraint('vlan_id'),
|
||||
)
|
||||
|
||||
op.rename_table('cisco_credentials', 'credentials')
|
||||
op.rename_table('cisco_nexusport_bindings', 'nexusport_bindings')
|
||||
op.rename_table('cisco_qos_policies', 'qoss')
|
@ -1,63 +0,0 @@
|
||||
# Copyright 2013 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
"""quota_in_plumgrid_plugin
|
||||
|
||||
Revision ID: 27ef74513d33
|
||||
Revises: 3a520dd165d0
|
||||
Create Date: 2013-10-08 10:59:19.860397
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '27ef74513d33'
|
||||
down_revision = '3a520dd165d0'
|
||||
|
||||
# Change to ['*'] if this migration applies to all plugins
|
||||
|
||||
migration_for_plugins = [
|
||||
'neutron.plugins.plumgrid.plumgrid_plugin.plumgrid_plugin.'
|
||||
'NeutronPluginPLUMgridV2'
|
||||
]
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
from neutron.db import migration
|
||||
|
||||
|
||||
def upgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table(
|
||||
'quotas',
|
||||
sa.Column('id', sa.String(length=36), nullable=False),
|
||||
sa.Column('tenant_id', sa.String(length=255), nullable=True),
|
||||
sa.Column('resource', sa.String(length=255), nullable=True),
|
||||
sa.Column('limit', sa.Integer(), nullable=True),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_table('quotas')
|
||||
### end Alembic commands ###
|
@ -1,63 +0,0 @@
|
||||
# Copyright 2013 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
"""NEC Port Binding
|
||||
|
||||
Revision ID: 2a3bae1ceb8
|
||||
Revises: 46a0efbd8f0
|
||||
Create Date: 2013-08-22 11:09:19.955386
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '2a3bae1ceb8'
|
||||
down_revision = '46a0efbd8f0'
|
||||
|
||||
# Change to ['*'] if this migration applies to all plugins
|
||||
|
||||
migration_for_plugins = [
|
||||
'neutron.plugins.nec.nec_plugin.NECPluginV2'
|
||||
]
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
from neutron.db import migration
|
||||
|
||||
|
||||
def upgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.create_table(
|
||||
'portbindingports',
|
||||
sa.Column('port_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('host', sa.String(length=255), nullable=False),
|
||||
sa.ForeignKeyConstraint(['port_id'], ['ports.id'], ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('port_id')
|
||||
)
|
||||
op.create_foreign_key(
|
||||
'portinfos_ibfk_1',
|
||||
source='portinfos', referent='ports',
|
||||
local_cols=['id'], remote_cols=['id'],
|
||||
ondelete='CASCADE')
|
||||
|
||||
|
||||
def downgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.drop_constraint('portinfos_ibfk_1', 'portinfos', 'foreignkey')
|
||||
op.drop_table('portbindingports')
|
@ -1,86 +0,0 @@
|
||||
# Copyright 2013 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
"""cisco plugin cleanup
|
||||
|
||||
Revision ID: 2a6d0b51f4bb
|
||||
Revises: 1d76643bcec4
|
||||
Create Date: 2013-01-17 22:24:37.730466
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '2a6d0b51f4bb'
|
||||
down_revision = '1d76643bcec4'
|
||||
|
||||
# Change to ['*'] if this migration applies to all plugins
|
||||
|
||||
migration_for_plugins = [
|
||||
'neutron.plugins.cisco.network_plugin.PluginV2'
|
||||
]
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
from neutron.db import migration
|
||||
|
||||
|
||||
def upgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.drop_table(u'portprofile_bindings')
|
||||
op.drop_table(u'portprofiles')
|
||||
op.drop_table(u'port_bindings')
|
||||
|
||||
|
||||
def downgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.create_table(
|
||||
u'port_bindings',
|
||||
sa.Column(u'id', sa.Integer(), autoincrement=True,
|
||||
nullable=False),
|
||||
sa.Column(u'port_id', sa.String(255), nullable=False),
|
||||
sa.Column(u'blade_intf_dn', sa.String(255), nullable=False),
|
||||
sa.Column(u'portprofile_name', sa.String(255),
|
||||
nullable=True),
|
||||
sa.Column(u'vlan_name', sa.String(255), nullable=True),
|
||||
sa.Column(u'vlan_id', sa.Integer(), nullable=True),
|
||||
sa.Column(u'qos', sa.String(255), nullable=True),
|
||||
sa.Column(u'tenant_id', sa.String(255), nullable=True),
|
||||
sa.Column(u'vif_id', sa.String(255), nullable=True),
|
||||
sa.PrimaryKeyConstraint(u'id')
|
||||
)
|
||||
op.create_table(
|
||||
u'portprofiles',
|
||||
sa.Column(u'uuid', sa.String(255), nullable=False),
|
||||
sa.Column(u'name', sa.String(255), nullable=True),
|
||||
sa.Column(u'vlan_id', sa.Integer(), nullable=True),
|
||||
sa.Column(u'qos', sa.String(255), nullable=True),
|
||||
sa.PrimaryKeyConstraint(u'uuid')
|
||||
)
|
||||
op.create_table(
|
||||
u'portprofile_bindings',
|
||||
sa.Column(u'id', sa.String(255), nullable=False),
|
||||
sa.Column(u'tenant_id', sa.String(255), nullable=True),
|
||||
sa.Column(u'port_id', sa.String(255), nullable=True),
|
||||
sa.Column(u'portprofile_id', sa.String(255), nullable=True),
|
||||
sa.Column(u'default', sa.Boolean(), nullable=False),
|
||||
sa.ForeignKeyConstraint(['portprofile_id'], ['portprofiles.uuid'], ),
|
||||
sa.ForeignKeyConstraint(['port_id'], ['ports.id'], ),
|
||||
sa.PrimaryKeyConstraint(u'id')
|
||||
)
|
@ -1,54 +0,0 @@
|
||||
# Copyright 2013 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
"""l3_support
|
||||
|
||||
Revision ID: 2c4af419145b
|
||||
Revises: folsom
|
||||
Create Date: 2013-03-11 19:26:45.697774
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '2c4af419145b'
|
||||
down_revision = 'folsom'
|
||||
|
||||
# Change to ['*'] if this migration applies to all plugins
|
||||
|
||||
migration_for_plugins = [
|
||||
'neutron.plugins.bigswitch.plugin.NeutronRestProxyV2',
|
||||
'neutron.plugins.hyperv.hyperv_neutron_plugin.HyperVNeutronPlugin',
|
||||
'neutron.plugins.midonet.plugin.MidonetPluginV2',
|
||||
'neutron.plugins.nicira.NeutronPlugin.NvpPluginV2',
|
||||
'neutron.plugins.nicira.NeutronServicePlugin.NvpAdvancedPlugin',
|
||||
'neutron.plugins.vmware.plugin.NsxPlugin',
|
||||
'neutron.plugins.vmware.plugin.NsxServicePlugin',
|
||||
'neutron.plugins.embrane.plugins.embrane_ovs_plugin.EmbraneOvsPlugin',
|
||||
]
|
||||
|
||||
from neutron.db import migration
|
||||
from neutron.db.migration.alembic_migrations import common_ext_ops
|
||||
|
||||
|
||||
def upgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
common_ext_ops.upgrade_l3()
|
||||
|
||||
|
||||
def downgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
common_ext_ops.downgrade_l3()
|
@ -16,14 +16,14 @@
|
||||
"""floatingip_status
|
||||
|
||||
Revision ID: 2eeaf963a447
|
||||
Revises: f44ab9871cd6
|
||||
Revises: e766b19a3bb
|
||||
Create Date: 2014-01-14 11:58:13.754747
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '2eeaf963a447'
|
||||
down_revision = 'f44ab9871cd6'
|
||||
down_revision = 'e766b19a3bb'
|
||||
|
||||
# This migration is applied to all L3 capable plugins
|
||||
|
||||
@ -73,4 +73,4 @@ def upgrade(active_plugins=None, options=None):
|
||||
|
||||
|
||||
def downgrade(active_plugins=None, options=None):
|
||||
pass
|
||||
pass
|
||||
|
@ -1,68 +0,0 @@
|
||||
# Copyright 2013 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
"""ml2 portbinding
|
||||
|
||||
Revision ID: 32a65f71af51
|
||||
Revises: 14f24494ca31
|
||||
Create Date: 2013-09-03 08:40:22.706651
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '32a65f71af51'
|
||||
down_revision = '14f24494ca31'
|
||||
|
||||
# Change to ['*'] if this migration applies to all plugins
|
||||
|
||||
migration_for_plugins = [
|
||||
'neutron.plugins.ml2.plugin.Ml2Plugin'
|
||||
]
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
from neutron.db import migration
|
||||
|
||||
|
||||
def upgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.create_table(
|
||||
'ml2_port_bindings',
|
||||
sa.Column('port_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('host', sa.String(length=255), nullable=False),
|
||||
sa.Column('vif_type', sa.String(length=64), nullable=False),
|
||||
sa.Column('cap_port_filter', sa.Boolean(), nullable=False),
|
||||
sa.Column('driver', sa.String(length=64), nullable=True),
|
||||
sa.Column('segment', sa.String(length=36), nullable=True),
|
||||
sa.ForeignKeyConstraint(['port_id'], ['ports.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.ForeignKeyConstraint(['segment'], ['ml2_network_segments.id'],
|
||||
ondelete='SET NULL'),
|
||||
sa.PrimaryKeyConstraint('port_id')
|
||||
)
|
||||
|
||||
# Note that 176a85fc7d79_add_portbindings_db.py was never enabled
|
||||
# for ml2, so there is no need to drop the portbindingports table
|
||||
# that is no longer used.
|
||||
|
||||
|
||||
def downgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.drop_table('ml2_port_bindings')
|
@ -1,56 +0,0 @@
|
||||
# Copyright 2013 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
"""remove TunnelIP model
|
||||
|
||||
Revision ID: 32b517556ec9
|
||||
Revises: 176a85fc7d79
|
||||
Create Date: 2013-05-23 06:46:57.390838
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '32b517556ec9'
|
||||
down_revision = '176a85fc7d79'
|
||||
|
||||
# Change to ['*'] if this migration applies to all plugins
|
||||
|
||||
migration_for_plugins = [
|
||||
'neutron.plugins.openvswitch.ovs_neutron_plugin.OVSNeutronPluginV2'
|
||||
]
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
from neutron.db import migration
|
||||
|
||||
|
||||
def upgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.drop_table('ovs_tunnel_ips')
|
||||
|
||||
|
||||
def downgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.create_table(
|
||||
'ovs_tunnel_ips',
|
||||
sa.Column('ip_address', sa.String(length=255), nullable=False),
|
||||
sa.PrimaryKeyConstraint('ip_address')
|
||||
)
|
@ -1,53 +0,0 @@
|
||||
# Copyright 2013 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
"""vpnaas peer_address size increase
|
||||
|
||||
Revision ID: 338d7508968c
|
||||
Revises: 4a666eb208c2
|
||||
Create Date: 2013-09-16 11:31:39.410189
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '338d7508968c'
|
||||
down_revision = '4a666eb208c2'
|
||||
|
||||
# Change to ['*'] if this migration applies to all plugins
|
||||
|
||||
migration_for_plugins = [
|
||||
'neutron.services.vpn.plugin.VPNDriverPlugin'
|
||||
]
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
from neutron.db import migration
|
||||
|
||||
|
||||
def upgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.alter_column('ipsec_site_connections', 'peer_address',
|
||||
type_=sa.String(255), existing_type=sa.String(64))
|
||||
|
||||
|
||||
def downgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.alter_column('ipsec_site_connections', 'peer_address',
|
||||
type_=sa.String(64), existing_type=sa.String(255))
|
@ -1,56 +0,0 @@
|
||||
# Copyright 2013 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
"""remove status from HealthMonitor
|
||||
|
||||
Revision ID: 35c7c198ddea
|
||||
Revises: 11c6e18605c8
|
||||
Create Date: 2013-08-02 23:14:54.037976
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '35c7c198ddea'
|
||||
down_revision = '11c6e18605c8'
|
||||
|
||||
# Change to ['*'] if this migration applies to all plugins
|
||||
|
||||
migration_for_plugins = [
|
||||
'neutron.services.loadbalancer.plugin.LoadBalancerPlugin',
|
||||
]
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
from neutron.db import migration
|
||||
|
||||
|
||||
def upgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
op.drop_column('healthmonitors', 'status')
|
||||
op.drop_column('healthmonitors', 'status_description')
|
||||
|
||||
|
||||
def downgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.add_column('healthmonitors', sa.Column('status',
|
||||
sa.String(16),
|
||||
nullable=False))
|
||||
op.add_column('healthmonitors', sa.Column('status_description',
|
||||
sa.String(255)))
|
@ -1,99 +0,0 @@
|
||||
# Copyright 2013 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
"""nvp_network_gw
|
||||
|
||||
Revision ID: 363468ac592c
|
||||
Revises: 1c33fa3cd1a1
|
||||
Create Date: 2013-02-07 03:19:14.455372
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '363468ac592c'
|
||||
down_revision = '1c33fa3cd1a1'
|
||||
|
||||
# Change to ['*'] if this migration applies to all plugins
|
||||
|
||||
migration_for_plugins = [
|
||||
'neutron.plugins.nicira.NeutronPlugin.NvpPluginV2',
|
||||
'neutron.plugins.nicira.NeutronServicePlugin.NvpAdvancedPlugin',
|
||||
'neutron.plugins.vmware.plugin.NsxPlugin',
|
||||
'neutron.plugins.vmware.plugin.NsxServicePlugin'
|
||||
]
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
from neutron.db import migration
|
||||
|
||||
net_conn_seg_type = sa.Enum('flat', 'vlan', name="net_conn_seg_type")
|
||||
|
||||
|
||||
def upgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
op.create_table('networkgateways',
|
||||
sa.Column('id', sa.String(length=36), nullable=False),
|
||||
sa.Column('name', sa.String(length=255), nullable=True),
|
||||
sa.Column('tenant_id', sa.String(length=36),
|
||||
nullable=True),
|
||||
sa.Column('default', sa.Boolean(), nullable=True),
|
||||
sa.PrimaryKeyConstraint('id'))
|
||||
op.create_table('networkgatewaydevices',
|
||||
sa.Column('id', sa.String(length=36), nullable=False),
|
||||
sa.Column('network_gateway_id', sa.String(length=36),
|
||||
nullable=True),
|
||||
sa.Column('interface_name', sa.String(length=64),
|
||||
nullable=True),
|
||||
sa.ForeignKeyConstraint(['network_gateway_id'],
|
||||
['networkgateways.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('id'))
|
||||
op.create_table('networkconnections',
|
||||
sa.Column('tenant_id', sa.String(length=255),
|
||||
nullable=True),
|
||||
sa.Column('network_gateway_id', sa.String(length=36),
|
||||
nullable=True),
|
||||
sa.Column('network_id', sa.String(length=36),
|
||||
nullable=True),
|
||||
sa.Column('segmentation_type', net_conn_seg_type,
|
||||
nullable=True),
|
||||
sa.Column('segmentation_id', sa.Integer(),
|
||||
nullable=True),
|
||||
sa.Column('port_id', sa.String(length=36),
|
||||
nullable=False),
|
||||
sa.ForeignKeyConstraint(['network_gateway_id'],
|
||||
['networkgateways.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.ForeignKeyConstraint(['network_id'], ['networks.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.ForeignKeyConstraint(['port_id'], ['ports.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('port_id'),
|
||||
sa.UniqueConstraint('network_gateway_id',
|
||||
'segmentation_type',
|
||||
'segmentation_id'))
|
||||
|
||||
|
||||
def downgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.drop_table('networkconnections')
|
||||
net_conn_seg_type.drop(op.get_bind(), checkfirst=False)
|
||||
op.drop_table('networkgatewaydevices')
|
||||
op.drop_table('networkgateways')
|
@ -1,60 +0,0 @@
|
||||
# Copyright 2013 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
"""nvp_portmap
|
||||
|
||||
Revision ID: 38335592a0dc
|
||||
Revises: 49332180ca96
|
||||
Create Date: 2013-01-15 06:04:56.328991
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '38335592a0dc'
|
||||
down_revision = '49332180ca96'
|
||||
|
||||
# Change to ['*'] if this migration applies to all plugins
|
||||
|
||||
migration_for_plugins = [
|
||||
'neutron.plugins.nicira.NeutronPlugin.NvpPluginV2',
|
||||
'neutron.plugins.nicira.NeutronServicePlugin.NvpAdvancedPlugin',
|
||||
'neutron.plugins.vmware.plugin.NsxPlugin',
|
||||
'neutron.plugins.vmware.plugin.NsxServicePlugin'
|
||||
]
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
from neutron.db import migration
|
||||
|
||||
|
||||
def upgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.create_table(
|
||||
'quantum_nvp_port_mapping',
|
||||
sa.Column('quantum_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('nvp_id', sa.String(length=36), nullable=True),
|
||||
sa.ForeignKeyConstraint(['quantum_id'], ['ports.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('quantum_id'))
|
||||
|
||||
|
||||
def downgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.drop_table('quantum_nvp_port_mapping')
|
@ -1,55 +0,0 @@
|
||||
# Copyright 2013 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
"""Cisco N1KV overlay support
|
||||
|
||||
Revision ID: 38fc1f6789f8
|
||||
Revises: 1efb85914233
|
||||
Create Date: 2013-08-20 18:31:16.158387
|
||||
|
||||
"""
|
||||
|
||||
revision = '38fc1f6789f8'
|
||||
down_revision = '1efb85914233'
|
||||
|
||||
migration_for_plugins = [
|
||||
'neutron.plugins.cisco.network_plugin.PluginV2'
|
||||
]
|
||||
|
||||
import sqlalchemy as sa
|
||||
|
||||
from neutron.db import migration
|
||||
|
||||
|
||||
new_type = sa.Enum('vlan', 'overlay', 'trunk', 'multi-segment',
|
||||
name='vlan_type')
|
||||
old_type = sa.Enum('vlan', 'vxlan', 'trunk', 'multi-segment',
|
||||
name='vlan_type')
|
||||
|
||||
|
||||
def upgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
migration.alter_enum('cisco_network_profiles', 'segment_type', new_type,
|
||||
nullable=False)
|
||||
|
||||
|
||||
def downgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
migration.alter_enum('cisco_network_profiles', 'segment_type', old_type,
|
||||
nullable=False)
|
@ -1,57 +0,0 @@
|
||||
# Copyright 2013 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
"""Cisco Nexus multi-switch
|
||||
|
||||
Revision ID: 3a520dd165d0
|
||||
Revises: 2528ceb28230
|
||||
Create Date: 2013-09-28 15:23:38.872682
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '3a520dd165d0'
|
||||
down_revision = '2528ceb28230'
|
||||
|
||||
# Change to ['*'] if this migration applies to all plugins
|
||||
|
||||
migration_for_plugins = [
|
||||
'neutron.plugins.cisco.network_plugin.PluginV2'
|
||||
]
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
from neutron.db import migration
|
||||
|
||||
|
||||
def upgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.add_column(
|
||||
'cisco_nexusport_bindings',
|
||||
sa.Column('instance_id', sa.String(length=255), nullable=False))
|
||||
op.add_column(
|
||||
'cisco_nexusport_bindings',
|
||||
sa.Column('switch_ip', sa.String(length=255), nullable=False))
|
||||
|
||||
|
||||
def downgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.drop_column('cisco_nexusport_bindings', 'switch_ip')
|
||||
op.drop_column('cisco_nexusport_bindings', 'instance_id')
|
@ -1,82 +0,0 @@
|
||||
# Copyright 2013 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
"""NEC plugin sharednet
|
||||
|
||||
Revision ID: 3b54bf9e29f7
|
||||
Revises: 511471cc46b
|
||||
Create Date: 2013-02-17 09:21:48.287134
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '3b54bf9e29f7'
|
||||
down_revision = '511471cc46b'
|
||||
|
||||
# Change to ['*'] if this migration applies to all plugins
|
||||
|
||||
migration_for_plugins = [
|
||||
'neutron.plugins.nec.nec_plugin.NECPluginV2'
|
||||
]
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
from neutron.db import migration
|
||||
|
||||
|
||||
def upgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.create_table(
|
||||
'ofctenantmappings',
|
||||
sa.Column('ofc_id', sa.String(length=255), nullable=False),
|
||||
sa.Column('quantum_id', sa.String(length=36), nullable=False),
|
||||
sa.PrimaryKeyConstraint('quantum_id'),
|
||||
sa.UniqueConstraint('ofc_id')
|
||||
)
|
||||
op.create_table(
|
||||
'ofcnetworkmappings',
|
||||
sa.Column('ofc_id', sa.String(length=255), nullable=False),
|
||||
sa.Column('quantum_id', sa.String(length=36), nullable=False),
|
||||
sa.PrimaryKeyConstraint('quantum_id'),
|
||||
sa.UniqueConstraint('ofc_id')
|
||||
)
|
||||
op.create_table(
|
||||
'ofcportmappings',
|
||||
sa.Column('ofc_id', sa.String(length=255), nullable=False),
|
||||
sa.Column('quantum_id', sa.String(length=36), nullable=False),
|
||||
sa.PrimaryKeyConstraint('quantum_id'),
|
||||
sa.UniqueConstraint('ofc_id')
|
||||
)
|
||||
op.create_table(
|
||||
'ofcfiltermappings',
|
||||
sa.Column('ofc_id', sa.String(length=255), nullable=False),
|
||||
sa.Column('quantum_id', sa.String(length=36), nullable=False),
|
||||
sa.PrimaryKeyConstraint('quantum_id'),
|
||||
sa.UniqueConstraint('ofc_id')
|
||||
)
|
||||
|
||||
|
||||
def downgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.drop_table('ofcfiltermappings')
|
||||
op.drop_table('ofcportmappings')
|
||||
op.drop_table('ofcnetworkmappings')
|
||||
op.drop_table('ofctenantmappings')
|
@ -1,110 +0,0 @@
|
||||
# Copyright 2013 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
"""add multiprovider
|
||||
|
||||
Revision ID: 3c6e57a23db4
|
||||
Revises: 86cf4d88bd3
|
||||
Create Date: 2013-07-10 12:43:35.769283
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '3c6e57a23db4'
|
||||
down_revision = '86cf4d88bd3'
|
||||
|
||||
# Change to ['*'] if this migration applies to all plugins
|
||||
|
||||
migration_for_plugins = [
|
||||
'neutron.plugins.nicira.NeutronPlugin.NvpPluginV2',
|
||||
'neutron.plugins.nicira.NeutronServicePlugin.NvpAdvancedPlugin',
|
||||
'neutron.plugins.vmware.plugin.NsxPlugin',
|
||||
'neutron.plugins.vmware.plugin.NsxServicePlugin'
|
||||
]
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import postgresql
|
||||
|
||||
from neutron.db import migration
|
||||
|
||||
|
||||
def get_enum():
|
||||
engine = op.get_bind().engine
|
||||
# In PostgreSQL types created separately, so if type was already created in
|
||||
# 1341ed32cc1e_nvp_netbinding_update it should be created one time.
|
||||
# Use parameter create_type=False for that.
|
||||
if engine.name == 'postgresql':
|
||||
return postgresql.ENUM('flat', 'vlan', 'stt', 'gre', 'l3_ext',
|
||||
name='nvp_network_bindings_binding_type',
|
||||
create_type=False)
|
||||
else:
|
||||
return sa.Enum('flat', 'vlan', 'stt', 'gre', 'l3_ext',
|
||||
name='nvp_network_bindings_binding_type')
|
||||
|
||||
|
||||
def upgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.create_table(
|
||||
'nvp_multi_provider_networks',
|
||||
sa.Column('network_id', sa.String(length=36), nullable=False),
|
||||
sa.ForeignKeyConstraint(['network_id'], ['networks.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('network_id'))
|
||||
op.create_table('rename_nvp_network_bindings',
|
||||
sa.Column('network_id', sa.String(length=36),
|
||||
primary_key=True),
|
||||
sa.Column('binding_type', get_enum(),
|
||||
nullable=False, primary_key=True),
|
||||
sa.Column('phy_uuid', sa.String(36), primary_key=True,
|
||||
nullable=True),
|
||||
sa.Column('vlan_id', sa.Integer, primary_key=True,
|
||||
nullable=True, autoincrement=False))
|
||||
# copy data from nvp_network_bindings into rename_nvp_network_bindings
|
||||
op.execute("INSERT INTO rename_nvp_network_bindings SELECT network_id, "
|
||||
"binding_type, phy_uuid, vlan_id from nvp_network_bindings")
|
||||
|
||||
op.drop_table('nvp_network_bindings')
|
||||
op.rename_table('rename_nvp_network_bindings', 'nvp_network_bindings')
|
||||
|
||||
|
||||
def downgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
# Delete the multi_provider_network entries from nvp_network_bindings
|
||||
op.execute("DELETE from nvp_network_bindings WHERE network_id IN "
|
||||
"(SELECT network_id from nvp_multi_provider_networks)")
|
||||
# create table with previous contains
|
||||
op.create_table('rename_nvp_network_bindings',
|
||||
sa.Column('network_id', sa.String(length=36),
|
||||
primary_key=True),
|
||||
sa.Column('binding_type',
|
||||
get_enum(),
|
||||
nullable=False),
|
||||
sa.Column('phy_uuid', sa.String(36),
|
||||
nullable=True),
|
||||
sa.Column('vlan_id', sa.Integer,
|
||||
nullable=True, autoincrement=False))
|
||||
|
||||
# copy data from nvp_network_bindings into rename_nvp_network_bindings
|
||||
op.execute("INSERT INTO rename_nvp_network_bindings SELECT network_id, "
|
||||
"binding_type, phy_uuid, vlan_id from nvp_network_bindings")
|
||||
|
||||
op.drop_table('nvp_network_bindings')
|
||||
op.rename_table('rename_nvp_network_bindings', 'nvp_network_bindings')
|
||||
op.drop_table('nvp_multi_provider_networks')
|
@ -1,61 +0,0 @@
|
||||
# Copyright 2013 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
"""Table to track port to host associations
|
||||
|
||||
Revision ID: 3cabb850f4a5
|
||||
Revises: 5918cbddab04
|
||||
Create Date: 2013-06-24 14:30:33.533562
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '3cabb850f4a5'
|
||||
down_revision = '5918cbddab04'
|
||||
|
||||
# Change to ['*'] if this migration applies to all plugins
|
||||
|
||||
migration_for_plugins = [
|
||||
'neutron.plugins.bigswitch.plugin.NeutronRestProxyV2'
|
||||
]
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
from neutron.db import migration
|
||||
|
||||
|
||||
def upgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table('portlocations',
|
||||
sa.Column('port_id', sa.String(length=255),
|
||||
primary_key=True, nullable=False),
|
||||
sa.Column('host_id',
|
||||
sa.String(length=255), nullable=False)
|
||||
)
|
||||
### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_table('portlocations')
|
||||
### end Alembic commands ###
|
@ -1,102 +0,0 @@
|
||||
# Copyright 2013 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
"""security_groups
|
||||
|
||||
Revision ID: 3cb5d900c5de
|
||||
Revises: 48b6f43f7471
|
||||
Create Date: 2013-01-08 00:13:43.051078
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '3cb5d900c5de'
|
||||
down_revision = '48b6f43f7471'
|
||||
|
||||
# Change to ['*'] if this migration applies to all plugins
|
||||
|
||||
migration_for_plugins = [
|
||||
'neutron.plugins.linuxbridge.lb_neutron_plugin.LinuxBridgePluginV2',
|
||||
'neutron.plugins.nicira.NeutronPlugin.NvpPluginV2',
|
||||
'neutron.plugins.nicira.NeutronServicePlugin.NvpAdvancedPlugin',
|
||||
'neutron.plugins.openvswitch.ovs_neutron_plugin.OVSNeutronPluginV2',
|
||||
'neutron.plugins.nec.nec_plugin.NECPluginV2',
|
||||
'neutron.plugins.ryu.ryu_neutron_plugin.RyuNeutronPluginV2',
|
||||
'neutron.plugins.vmware.plugin.NsxPlugin',
|
||||
'neutron.plugins.vmware.plugin.NsxServicePlugin',
|
||||
'neutron.plugins.oneconvergence.plugin.OneConvergencePluginV2',
|
||||
]
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
from neutron.db import migration
|
||||
|
||||
securitygrouprules_direction = sa.Enum('ingress', 'egress',
|
||||
name='securitygrouprules_direction')
|
||||
|
||||
|
||||
def upgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table(
|
||||
'securitygroups',
|
||||
sa.Column('tenant_id', sa.String(length=255), nullable=True),
|
||||
sa.Column('id', sa.String(length=36), nullable=False),
|
||||
sa.Column('name', sa.String(length=255), nullable=True),
|
||||
sa.Column('description', sa.String(length=255), nullable=True),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
op.create_table(
|
||||
'securitygrouprules',
|
||||
sa.Column('tenant_id', sa.String(length=255), nullable=True),
|
||||
sa.Column('id', sa.String(length=36), nullable=False),
|
||||
sa.Column('security_group_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('remote_group_id', sa.String(length=36), nullable=True),
|
||||
sa.Column('direction', securitygrouprules_direction, nullable=True),
|
||||
sa.Column('ethertype', sa.String(length=40), nullable=True),
|
||||
sa.Column('protocol', sa.String(length=40), nullable=True),
|
||||
sa.Column('port_range_min', sa.Integer(), nullable=True),
|
||||
sa.Column('port_range_max', sa.Integer(), nullable=True),
|
||||
sa.Column('remote_ip_prefix', sa.String(length=255), nullable=True),
|
||||
sa.ForeignKeyConstraint(['security_group_id'], ['securitygroups.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.ForeignKeyConstraint(['remote_group_id'], ['securitygroups.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
op.create_table(
|
||||
'securitygroupportbindings',
|
||||
sa.Column('port_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('security_group_id', sa.String(length=36), nullable=False),
|
||||
sa.ForeignKeyConstraint(['port_id'], ['ports.id'], ondelete='CASCADE'),
|
||||
sa.ForeignKeyConstraint(['security_group_id'], ['securitygroups.id']),
|
||||
sa.PrimaryKeyConstraint('port_id', 'security_group_id')
|
||||
)
|
||||
### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_table('securitygroupportbindings')
|
||||
op.drop_table('securitygrouprules')
|
||||
securitygrouprules_direction.drop(op.get_bind(), checkfirst=False)
|
||||
op.drop_table('securitygroups')
|
||||
### end Alembic commands ###
|
@ -1,61 +0,0 @@
|
||||
# Copyright 2013 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
"""nvp_mac_learning
|
||||
|
||||
Revision ID: 3cbf70257c28
|
||||
Revises: 5ac71e65402c
|
||||
Create Date: 2013-05-15 10:15:50.875314
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '3cbf70257c28'
|
||||
down_revision = '5ac71e65402c'
|
||||
|
||||
# Change to ['*'] if this migration applies to all plugins
|
||||
|
||||
migration_for_plugins = [
|
||||
'neutron.plugins.nicira.NeutronPlugin.NvpPluginV2',
|
||||
'neutron.plugins.nicira.NeutronServicePlugin.NvpAdvancedPlugin',
|
||||
'neutron.plugins.vmware.plugin.NsxPlugin',
|
||||
'neutron.plugins.vmware.plugin.NsxServicePlugin'
|
||||
]
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
from neutron.db import migration
|
||||
|
||||
|
||||
def upgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.create_table(
|
||||
'maclearningstates',
|
||||
sa.Column('port_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('mac_learning_enabled', sa.Boolean(), nullable=False),
|
||||
sa.ForeignKeyConstraint(
|
||||
['port_id'], ['ports.id'], ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('port_id'))
|
||||
|
||||
|
||||
def downgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.drop_table('maclearningstates')
|
@ -1,80 +0,0 @@
|
||||
# Copyright 2013 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
"""nvp lbaas plugin
|
||||
|
||||
Revision ID: 3d6fae8b70b0
|
||||
Revises: 3ed8f075e38a
|
||||
Create Date: 2013-09-13 19:34:41.522665
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '3d6fae8b70b0'
|
||||
down_revision = '3ed8f075e38a'
|
||||
|
||||
# Change to ['*'] if this migration applies to all plugins
|
||||
|
||||
migration_for_plugins = [
|
||||
'neutron.plugins.nicira.NeutronServicePlugin.NvpAdvancedPlugin'
|
||||
]
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
from neutron.db import migration
|
||||
|
||||
|
||||
def upgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.create_table(
|
||||
'vcns_edge_pool_bindings',
|
||||
sa.Column('pool_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('edge_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('pool_vseid', sa.String(length=36), nullable=True),
|
||||
sa.ForeignKeyConstraint(['pool_id'], ['pools.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('pool_id', 'edge_id')
|
||||
)
|
||||
op.create_table(
|
||||
'vcns_edge_monitor_bindings',
|
||||
sa.Column('monitor_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('edge_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('monitor_vseid', sa.String(length=36), nullable=True),
|
||||
sa.ForeignKeyConstraint(['monitor_id'], ['healthmonitors.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('monitor_id', 'edge_id')
|
||||
)
|
||||
op.create_table(
|
||||
'vcns_edge_vip_bindings',
|
||||
sa.Column('vip_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('edge_id', sa.String(length=36), nullable=True),
|
||||
sa.Column('vip_vseid', sa.String(length=36), nullable=True),
|
||||
sa.Column('app_profileid', sa.String(length=36), nullable=True),
|
||||
sa.ForeignKeyConstraint(['vip_id'], ['vips.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('vip_id')
|
||||
)
|
||||
|
||||
|
||||
def downgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.drop_table('vcns_edge_vip_bindings')
|
||||
op.drop_table('vcns_edge_monitor_bindings')
|
||||
op.drop_table('vcns_edge_pool_bindings')
|
@ -1,58 +0,0 @@
|
||||
# Copyright 2013 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
"""nvp fwaas plugin
|
||||
|
||||
Revision ID: 3ed8f075e38a
|
||||
Revises: 338d7508968c
|
||||
Create Date: 2013-09-13 19:14:25.509033
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '3ed8f075e38a'
|
||||
down_revision = '338d7508968c'
|
||||
|
||||
# Change to ['*'] if this migration applies to all plugins
|
||||
|
||||
migration_for_plugins = [
|
||||
'neutron.plugins.nicira.NeutronServicePlugin.NvpAdvancedPlugin'
|
||||
]
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
from neutron.db import migration
|
||||
|
||||
|
||||
def upgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.create_table(
|
||||
'vcns_firewall_rule_bindings',
|
||||
sa.Column('rule_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('edge_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('rule_vseid', sa.String(length=36), nullable=True),
|
||||
sa.ForeignKeyConstraint(['rule_id'], ['firewall_rules.id'], ),
|
||||
sa.PrimaryKeyConstraint('rule_id', 'edge_id')
|
||||
)
|
||||
|
||||
|
||||
def downgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.drop_table('vcns_firewall_rule_bindings')
|
@ -1,196 +0,0 @@
|
||||
# Copyright 2014 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
"""mlnx_initial
|
||||
|
||||
Revision ID: 40b0aff0302e
|
||||
Revises: 49f5e553f61f
|
||||
Create Date: 2014-01-12 14:51:49.273105
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '40b0aff0302e'
|
||||
down_revision = '49f5e553f61f'
|
||||
|
||||
# Change to ['*'] if this migration applies to all plugins
|
||||
|
||||
migration_for_plugins = [
|
||||
'neutron.plugins.mlnx.mlnx_plugin.MellanoxEswitchPlugin'
|
||||
]
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
from neutron.db import migration
|
||||
|
||||
securitygrouprules_direction = sa.Enum('ingress', 'egress',
|
||||
name='securitygrouprules_direction')
|
||||
|
||||
|
||||
def upgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.create_table(
|
||||
'securitygroups',
|
||||
sa.Column('tenant_id', sa.String(length=255), nullable=True),
|
||||
sa.Column('id', sa.String(length=36), nullable=False),
|
||||
sa.Column('name', sa.String(length=255), nullable=True),
|
||||
sa.Column('description', sa.String(length=255), nullable=True),
|
||||
sa.PrimaryKeyConstraint('id'),
|
||||
)
|
||||
|
||||
op.create_table(
|
||||
'segmentation_id_allocation',
|
||||
sa.Column('physical_network', sa.String(length=64), nullable=False),
|
||||
sa.Column('segmentation_id', sa.Integer(), autoincrement=False,
|
||||
nullable=False),
|
||||
sa.Column('allocated', sa.Boolean(), nullable=False),
|
||||
sa.PrimaryKeyConstraint('physical_network', 'segmentation_id'),
|
||||
)
|
||||
|
||||
op.create_table(
|
||||
'quotas',
|
||||
sa.Column('id', sa.String(length=36), nullable=False),
|
||||
sa.Column('tenant_id', sa.String(255), index=True),
|
||||
sa.Column('resource', sa.String(255)),
|
||||
sa.Column('limit', sa.Integer()),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
|
||||
op.create_table(
|
||||
'mlnx_network_bindings',
|
||||
sa.Column('network_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('network_type', sa.String(length=32), nullable=False),
|
||||
sa.Column('physical_network', sa.String(length=64), nullable=True),
|
||||
sa.Column('segmentation_id', sa.Integer(), nullable=False),
|
||||
sa.ForeignKeyConstraint(['network_id'], ['networks.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('network_id'),
|
||||
)
|
||||
|
||||
op.create_table(
|
||||
'networkdhcpagentbindings',
|
||||
sa.Column('network_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('dhcp_agent_id', sa.String(length=36), nullable=False),
|
||||
sa.ForeignKeyConstraint(['dhcp_agent_id'], ['agents.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.ForeignKeyConstraint(['network_id'], ['networks.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('network_id', 'dhcp_agent_id'),
|
||||
)
|
||||
|
||||
op.create_table(
|
||||
'securitygrouprules',
|
||||
sa.Column('tenant_id', sa.String(length=255), nullable=True),
|
||||
sa.Column('id', sa.String(length=36), nullable=False),
|
||||
sa.Column('security_group_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('remote_group_id', sa.String(length=36), nullable=True),
|
||||
sa.Column('direction', securitygrouprules_direction,
|
||||
nullable=True),
|
||||
sa.Column('ethertype', sa.String(length=40), nullable=True),
|
||||
sa.Column('protocol', sa.String(length=40), nullable=True),
|
||||
sa.Column('port_range_min', sa.Integer(), nullable=True),
|
||||
sa.Column('port_range_max', sa.Integer(), nullable=True),
|
||||
sa.Column('remote_ip_prefix', sa.String(length=255), nullable=True),
|
||||
sa.ForeignKeyConstraint(['remote_group_id'], ['securitygroups.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.ForeignKeyConstraint(['security_group_id'], ['securitygroups.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('id'),
|
||||
)
|
||||
|
||||
op.create_table(
|
||||
'port_profile',
|
||||
sa.Column('port_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('vnic_type', sa.String(length=32), nullable=False),
|
||||
sa.ForeignKeyConstraint(['port_id'], ['ports.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('port_id'),
|
||||
)
|
||||
|
||||
op.add_column('routers', sa.Column('enable_snat', sa.Boolean(),
|
||||
nullable=False, server_default="1"))
|
||||
op.create_table(
|
||||
'securitygroupportbindings',
|
||||
sa.Column('port_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('security_group_id', sa.String(length=36), nullable=False),
|
||||
sa.ForeignKeyConstraint(['port_id'], ['ports.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.ForeignKeyConstraint(['security_group_id'], ['securitygroups.id'],),
|
||||
sa.PrimaryKeyConstraint('port_id', 'security_group_id'),
|
||||
)
|
||||
|
||||
op.create_table(
|
||||
'portbindingports',
|
||||
sa.Column('port_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('host', sa.String(length=255), nullable=False),
|
||||
sa.ForeignKeyConstraint(['port_id'], ['ports.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('port_id'),
|
||||
)
|
||||
|
||||
op.rename_table(
|
||||
'routes',
|
||||
'subnetroutes',
|
||||
)
|
||||
|
||||
op.create_table(
|
||||
'routerl3agentbindings',
|
||||
sa.Column('id', sa.String(length=36), nullable=False),
|
||||
sa.Column('router_id', sa.String(length=36), nullable=True),
|
||||
sa.Column('l3_agent_id', sa.String(length=36), nullable=True),
|
||||
sa.ForeignKeyConstraint(['l3_agent_id'], ['agents.id'],
|
||||
ondelete='CASCADE'),
|
||||
|
||||
sa.ForeignKeyConstraint(['router_id'], ['routers.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('id'),
|
||||
)
|
||||
|
||||
op.create_table(
|
||||
'routerroutes',
|
||||
sa.Column('destination', sa.String(length=64), nullable=False),
|
||||
sa.Column('nexthop', sa.String(length=64), nullable=False),
|
||||
sa.Column('router_id', sa.String(length=36), nullable=False),
|
||||
sa.ForeignKeyConstraint(['router_id'], ['routers.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('destination', 'nexthop', 'router_id'),
|
||||
)
|
||||
|
||||
|
||||
def downgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.rename_table(
|
||||
'subnetroutes',
|
||||
'routes',
|
||||
)
|
||||
|
||||
op.drop_table('routerroutes')
|
||||
op.drop_table('routerl3agentbindings')
|
||||
op.drop_table('portbindingports')
|
||||
op.drop_table('securitygroupportbindings')
|
||||
op.drop_column('routers', 'enable_snat')
|
||||
op.drop_table('port_profile')
|
||||
op.drop_table('securitygrouprules')
|
||||
securitygrouprules_direction.drop(op.get_bind(), checkfirst=False)
|
||||
op.drop_table('networkdhcpagentbindings')
|
||||
op.drop_table('mlnx_network_bindings')
|
||||
op.drop_table('quotas')
|
||||
op.drop_table('segmentation_id_allocation')
|
||||
op.drop_table('securitygroups')
|
@ -1,61 +0,0 @@
|
||||
# Copyright 2013 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
"""nvp_dist_router
|
||||
|
||||
Revision ID: 40dffbf4b549
|
||||
Revises: 63afba73813
|
||||
Create Date: 2013-08-21 18:00:26.214923
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '40dffbf4b549'
|
||||
down_revision = '63afba73813'
|
||||
|
||||
# Change to ['*'] if this migration applies to all plugins
|
||||
|
||||
migration_for_plugins = [
|
||||
'neutron.plugins.nicira.NeutronPlugin.NvpPluginV2',
|
||||
'neutron.plugins.nicira.NeutronServicePlugin.NvpAdvancedPlugin',
|
||||
'neutron.plugins.vmware.plugin.NsxPlugin',
|
||||
'neutron.plugins.vmware.plugin.NsxServicePlugin'
|
||||
]
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
from neutron.db import migration
|
||||
|
||||
|
||||
def upgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.create_table(
|
||||
'nsxrouterextattributess',
|
||||
sa.Column('router_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('distributed', sa.Boolean(), nullable=False),
|
||||
sa.ForeignKeyConstraint(
|
||||
['router_id'], ['routers.id'], ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('router_id')
|
||||
)
|
||||
|
||||
|
||||
def downgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.drop_table('nsxrouterextattributess')
|
@ -1,94 +0,0 @@
|
||||
# Copyright 2013 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
"""nvp_qos
|
||||
|
||||
Revision ID: 45680af419f9
|
||||
Revises: 54c2c487e913
|
||||
Create Date: 2013-02-17 13:27:57.999631
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '45680af419f9'
|
||||
down_revision = '54c2c487e913'
|
||||
|
||||
# Change to ['*'] if this migration applies to all plugins
|
||||
|
||||
migration_for_plugins = [
|
||||
'neutron.plugins.nicira.NeutronPlugin.NvpPluginV2',
|
||||
'neutron.plugins.nicira.NeutronServicePlugin.NvpAdvancedPlugin',
|
||||
'neutron.plugins.vmware.plugin.NsxPlugin',
|
||||
'neutron.plugins.vmware.plugin.NsxServicePlugin'
|
||||
]
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
from neutron.db import migration
|
||||
|
||||
qosqueues_qos_marking = sa.Enum('untrusted', 'trusted',
|
||||
name='qosqueues_qos_marking')
|
||||
|
||||
|
||||
def upgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table(
|
||||
'qosqueues',
|
||||
sa.Column('tenant_id', sa.String(length=255), nullable=True),
|
||||
sa.Column('id', sa.String(length=36), nullable=False),
|
||||
sa.Column('name', sa.String(length=255), nullable=True),
|
||||
sa.Column('default', sa.Boolean(), nullable=True),
|
||||
sa.Column('min', sa.Integer(), nullable=False),
|
||||
sa.Column('max', sa.Integer(), nullable=True),
|
||||
sa.Column('qos_marking', qosqueues_qos_marking, nullable=True),
|
||||
sa.Column('dscp', sa.Integer(), nullable=True),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
op.create_table(
|
||||
'networkqueuemappings',
|
||||
sa.Column('network_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('queue_id', sa.String(length=36), nullable=True),
|
||||
sa.ForeignKeyConstraint(['network_id'], ['networks.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.ForeignKeyConstraint(['queue_id'], ['qosqueues.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('network_id')
|
||||
)
|
||||
op.create_table(
|
||||
'portqueuemappings',
|
||||
sa.Column('port_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('queue_id', sa.String(length=36), nullable=False),
|
||||
sa.ForeignKeyConstraint(['port_id'], ['ports.id'], ondelete='CASCADE'),
|
||||
sa.ForeignKeyConstraint(['queue_id'], ['qosqueues.id'], ),
|
||||
sa.PrimaryKeyConstraint('port_id', 'queue_id')
|
||||
)
|
||||
### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_table('portqueuemappings')
|
||||
op.drop_table('networkqueuemappings')
|
||||
op.drop_table('qosqueues')
|
||||
qosqueues_qos_marking.drop(op.get_bind(), checkfirst=False)
|
||||
### end Alembic commands ###
|
@ -1,87 +0,0 @@
|
||||
# Copyright 2013 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
"""agent scheduler
|
||||
|
||||
Revision ID: 4692d074d587
|
||||
Revises: 3b54bf9e29f7
|
||||
Create Date: 2013-02-21 23:01:50.370306
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '4692d074d587'
|
||||
down_revision = '3b54bf9e29f7'
|
||||
|
||||
# Change to ['*'] if this migration applies to all plugins
|
||||
|
||||
migration_for_plugins = [
|
||||
'neutron.plugins.brocade.NeutronPlugin.BrocadePluginV2',
|
||||
'neutron.plugins.linuxbridge.lb_neutron_plugin.LinuxBridgePluginV2',
|
||||
'neutron.plugins.openvswitch.ovs_neutron_plugin.OVSNeutronPluginV2',
|
||||
'neutron.plugins.nicira.NeutronPlugin.NvpPluginV2',
|
||||
'neutron.plugins.nicira.NeutronServicePlugin.NvpAdvancedPlugin',
|
||||
'neutron.plugins.nec.nec_plugin.NECPluginV2',
|
||||
'neutron.plugins.vmware.plugin.NsxPlugin',
|
||||
'neutron.plugins.vmware.plugin.NsxServicePlugin',
|
||||
'neutron.plugins.oneconvergence.plugin.OneConvergencePluginV2',
|
||||
'neutron.plugins.ml2.plugin.Ml2Plugin',
|
||||
'neutron.plugins.bigswitch.plugin.NeutronRestProxyV2'
|
||||
]
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
from neutron.db import migration
|
||||
|
||||
|
||||
def upgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table(
|
||||
'networkdhcpagentbindings',
|
||||
sa.Column('network_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('dhcp_agent_id', sa.String(length=36), nullable=False),
|
||||
sa.ForeignKeyConstraint(['dhcp_agent_id'], ['agents.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.ForeignKeyConstraint(['network_id'], ['networks.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('network_id', 'dhcp_agent_id')
|
||||
)
|
||||
op.create_table(
|
||||
'routerl3agentbindings',
|
||||
sa.Column('id', sa.String(length=36), nullable=False),
|
||||
sa.Column('router_id', sa.String(length=36), nullable=True),
|
||||
sa.Column('l3_agent_id', sa.String(length=36), nullable=True),
|
||||
sa.ForeignKeyConstraint(['l3_agent_id'], ['agents.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.ForeignKeyConstraint(['router_id'], ['routers.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_table('routerl3agentbindings')
|
||||
op.drop_table('networkdhcpagentbindings')
|
||||
### end Alembic commands ###
|
@ -1,78 +0,0 @@
|
||||
# Copyright 2013 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
"""cisco_n1kv_multisegment_trunk
|
||||
|
||||
Revision ID: 46a0efbd8f0
|
||||
Revises: 53bbd27ec841
|
||||
Create Date: 2013-08-20 20:44:08.711110
|
||||
|
||||
"""
|
||||
|
||||
revision = '46a0efbd8f0'
|
||||
down_revision = '53bbd27ec841'
|
||||
|
||||
migration_for_plugins = [
|
||||
'neutron.plugins.cisco.network_plugin.PluginV2'
|
||||
]
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
from neutron.db import migration
|
||||
|
||||
new_type = sa.Enum('vlan', 'vxlan', 'trunk', 'multi-segment', name='vlan_type')
|
||||
old_type = sa.Enum('vlan', 'vxlan', name='vlan_type')
|
||||
|
||||
|
||||
def upgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.create_table(
|
||||
'cisco_n1kv_trunk_segments',
|
||||
sa.Column('trunk_segment_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('segment_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('dot1qtag', sa.String(length=36), nullable=False),
|
||||
sa.ForeignKeyConstraint(['trunk_segment_id'], ['networks.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('trunk_segment_id', 'segment_id', 'dot1qtag')
|
||||
)
|
||||
op.create_table(
|
||||
'cisco_n1kv_multi_segments',
|
||||
sa.Column('multi_segment_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('segment1_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('segment2_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('encap_profile_name', sa.String(length=36), nullable=True),
|
||||
sa.ForeignKeyConstraint(['multi_segment_id'], ['networks.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('multi_segment_id', 'segment1_id',
|
||||
'segment2_id')
|
||||
)
|
||||
migration.alter_enum('cisco_network_profiles', 'segment_type', new_type,
|
||||
nullable=False)
|
||||
op.add_column('cisco_network_profiles',
|
||||
sa.Column('sub_type', sa.String(length=255), nullable=True))
|
||||
|
||||
|
||||
def downgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.drop_table('cisco_n1kv_trunk_segments')
|
||||
op.drop_table('cisco_n1kv_multi_segments')
|
||||
migration.alter_enum('cisco_network_profiles', 'segment_type', old_type,
|
||||
nullable=False)
|
||||
op.drop_column('cisco_network_profiles', 'sub_type')
|
@ -1,67 +0,0 @@
|
||||
# Copyright 2013 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
"""DB Migration for ML2 VXLAN Type Driver
|
||||
|
||||
Revision ID: 477a4488d3f4
|
||||
Revises: 20ae61555e95
|
||||
Create Date: 2013-07-09 14:14:33.158502
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '477a4488d3f4'
|
||||
down_revision = '20ae61555e95'
|
||||
|
||||
# Change to ['*'] if this migration applies to all plugins
|
||||
|
||||
migration_for_plugins = [
|
||||
'neutron.plugins.ml2.plugin.Ml2Plugin'
|
||||
]
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
from neutron.db import migration
|
||||
|
||||
|
||||
def upgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.create_table(
|
||||
'ml2_vxlan_allocations',
|
||||
sa.Column('vxlan_vni', sa.Integer, nullable=False,
|
||||
autoincrement=False),
|
||||
sa.Column('allocated', sa.Boolean, nullable=False),
|
||||
sa.PrimaryKeyConstraint('vxlan_vni')
|
||||
)
|
||||
|
||||
op.create_table(
|
||||
'ml2_vxlan_endpoints',
|
||||
sa.Column('ip_address', sa.String(length=64)),
|
||||
sa.Column('udp_port', sa.Integer(), nullable=False,
|
||||
autoincrement=False),
|
||||
sa.PrimaryKeyConstraint('ip_address', 'udp_port')
|
||||
)
|
||||
|
||||
|
||||
def downgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.drop_table('ml2_vxlan_allocations')
|
||||
op.drop_table('ml2_vxlan_endpoints')
|
@ -1,74 +0,0 @@
|
||||
# Copyright 2013 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
"""DB support for service types
|
||||
|
||||
Revision ID: 48b6f43f7471
|
||||
Revises: 5a875d0e5c
|
||||
Create Date: 2013-01-07 13:47:29.093160
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '48b6f43f7471'
|
||||
down_revision = '5a875d0e5c'
|
||||
|
||||
# Change to ['*'] if this migration applies to all plugins
|
||||
|
||||
migration_for_plugins = [
|
||||
'*'
|
||||
]
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
from neutron.db import migration
|
||||
|
||||
|
||||
def upgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.create_table(
|
||||
u'servicetypes',
|
||||
sa.Column(u'tenant_id', sa.String(255), nullable=True),
|
||||
sa.Column(u'id', sa.String(36), nullable=False),
|
||||
sa.Column(u'name', sa.String(255), nullable=True),
|
||||
sa.Column(u'description', sa.String(255), nullable=True),
|
||||
sa.Column(u'default', sa.Boolean(),
|
||||
autoincrement=False, nullable=False),
|
||||
sa.Column(u'num_instances', sa.Integer(),
|
||||
autoincrement=False, nullable=True),
|
||||
sa.PrimaryKeyConstraint(u'id'))
|
||||
op.create_table(
|
||||
u'servicedefinitions',
|
||||
sa.Column(u'id', sa.String(36), nullable=False),
|
||||
sa.Column(u'service_class', sa.String(length=255),
|
||||
nullable=False),
|
||||
sa.Column(u'plugin', sa.String(255), nullable=True),
|
||||
sa.Column(u'driver', sa.String(255), nullable=True),
|
||||
sa.Column(u'service_type_id', sa.String(36),
|
||||
nullable=False),
|
||||
sa.ForeignKeyConstraint(['service_type_id'], [u'servicetypes.id'],
|
||||
name=u'servicedefinitions_ibfk_1'),
|
||||
sa.PrimaryKeyConstraint(u'id', u'service_class', u'service_type_id'))
|
||||
|
||||
|
||||
def downgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.drop_table(u'servicedefinitions')
|
||||
op.drop_table(u'servicetypes')
|
@ -16,14 +16,14 @@
|
||||
"""Brocade ML2 Mech. Driver
|
||||
|
||||
Revision ID: 492a106273f8
|
||||
Revises: fcac4c42e2cc
|
||||
Revises: 2eeaf963a447
|
||||
Create Date: 2014-03-03 15:35:46.974523
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '492a106273f8'
|
||||
down_revision = 'fcac4c42e2cc'
|
||||
down_revision = '2eeaf963a447'
|
||||
|
||||
# Change to ['*'] if this migration applies to all plugins
|
||||
|
||||
@ -59,7 +59,8 @@ def upgrade(active_plugins=None, options=None):
|
||||
sa.Column('physical_interface', sa.String(length=36), nullable=True),
|
||||
sa.Column('vlan_id', sa.String(length=36), nullable=True),
|
||||
sa.Column('tenant_id', sa.String(length=255), nullable=True),
|
||||
sa.PrimaryKeyConstraint('id'))
|
||||
sa.PrimaryKeyConstraint('id'),
|
||||
sa.ForeignKeyConstraint(['network_id'], ['ml2_brocadenetworks.id']))
|
||||
|
||||
|
||||
def downgrade(active_plugins=None, options=None):
|
||||
|
@ -1,57 +0,0 @@
|
||||
# Copyright 2013 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
"""ryu plugin update
|
||||
|
||||
Revision ID: 49332180ca96
|
||||
Revises: 1149d7de0cfa
|
||||
Create Date: 2013-01-30 07:52:58.472885
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '49332180ca96'
|
||||
down_revision = '1149d7de0cfa'
|
||||
|
||||
# Change to ['*'] if this migration applies to all plugins
|
||||
|
||||
migration_for_plugins = [
|
||||
'neutron.plugins.ryu.ryu_neutron_plugin.RyuNeutronPluginV2'
|
||||
]
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
from neutron.db import migration
|
||||
|
||||
|
||||
def upgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.drop_table('ofp_server')
|
||||
|
||||
|
||||
def downgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.create_table(
|
||||
'ofp_server',
|
||||
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
|
||||
sa.Column('address', sa.String(length=255)),
|
||||
sa.Column('host_type', sa.String(length=255)),
|
||||
sa.PrimaryKeyConstraint(u'id')
|
||||
)
|
@ -1,95 +0,0 @@
|
||||
# Copyright 2013 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
"""security_groups
|
||||
|
||||
Revision ID: 49f5e553f61f
|
||||
Revises: 27ef74513d33
|
||||
Create Date: 2013-12-21 19:58:17.071412
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '49f5e553f61f'
|
||||
down_revision = '27ef74513d33'
|
||||
|
||||
# Change to ['*'] if this migration applies to all plugins
|
||||
|
||||
migration_for_plugins = [
|
||||
'neutron.plugins.ml2.plugin.Ml2Plugin'
|
||||
]
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
from neutron.db import migration
|
||||
|
||||
securitygrouprules_direction = sa.Enum('ingress', 'egress',
|
||||
name='securitygrouprules_direction')
|
||||
|
||||
|
||||
def upgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table(
|
||||
'securitygroups',
|
||||
sa.Column('tenant_id', sa.String(length=255), nullable=True),
|
||||
sa.Column('id', sa.String(length=36), nullable=False),
|
||||
sa.Column('name', sa.String(length=255), nullable=True),
|
||||
sa.Column('description', sa.String(length=255), nullable=True),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
op.create_table(
|
||||
'securitygrouprules',
|
||||
sa.Column('tenant_id', sa.String(length=255), nullable=True),
|
||||
sa.Column('id', sa.String(length=36), nullable=False),
|
||||
sa.Column('security_group_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('remote_group_id', sa.String(length=36), nullable=True),
|
||||
sa.Column('direction', securitygrouprules_direction,
|
||||
nullable=True),
|
||||
sa.Column('ethertype', sa.String(length=40), nullable=True),
|
||||
sa.Column('protocol', sa.String(length=40), nullable=True),
|
||||
sa.Column('port_range_min', sa.Integer(), nullable=True),
|
||||
sa.Column('port_range_max', sa.Integer(), nullable=True),
|
||||
sa.Column('remote_ip_prefix', sa.String(length=255), nullable=True),
|
||||
sa.ForeignKeyConstraint(['security_group_id'], ['securitygroups.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.ForeignKeyConstraint(['remote_group_id'], ['securitygroups.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
op.create_table(
|
||||
'securitygroupportbindings',
|
||||
sa.Column('port_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('security_group_id', sa.String(length=36), nullable=False),
|
||||
sa.ForeignKeyConstraint(['port_id'], ['ports.id'], ondelete='CASCADE'),
|
||||
sa.ForeignKeyConstraint(['security_group_id'], ['securitygroups.id']),
|
||||
sa.PrimaryKeyConstraint('port_id', 'security_group_id')
|
||||
)
|
||||
### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_table('securitygroupportbindings')
|
||||
op.drop_table('securitygrouprules')
|
||||
securitygrouprules_direction.drop(op.get_bind(), checkfirst=False)
|
||||
op.drop_table('securitygroups')
|
||||
### end Alembic commands ###
|
@ -1,68 +0,0 @@
|
||||
# Copyright 2013 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
"""service router
|
||||
|
||||
Revision ID: 4a666eb208c2
|
||||
Revises: 38fc1f6789f8
|
||||
Create Date: 2013-09-03 01:55:57.799217
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '4a666eb208c2'
|
||||
down_revision = '38fc1f6789f8'
|
||||
|
||||
# Change to ['*'] if this migration applies to all plugins
|
||||
# This migration must apply to both NVP/NSX plugins as it alters a table
|
||||
# used by both of them
|
||||
|
||||
migration_for_plugins = [
|
||||
'neutron.plugins.nicira.NeutronPlugin.NvpPluginV2',
|
||||
'neutron.plugins.nicira.NeutronServicePlugin.NvpAdvancedPlugin',
|
||||
'neutron.plugins.vmware.plugin.NsxPlugin',
|
||||
'neutron.plugins.vmware.plugin.NsxServicePlugin'
|
||||
]
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
from neutron.db import migration
|
||||
|
||||
|
||||
def upgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.create_table(
|
||||
'vcns_router_bindings',
|
||||
sa.Column('status', sa.String(length=16), nullable=False),
|
||||
sa.Column('status_description', sa.String(length=255), nullable=True),
|
||||
sa.Column('router_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('edge_id', sa.String(length=16), nullable=True),
|
||||
sa.Column('lswitch_id', sa.String(length=36), nullable=False),
|
||||
sa.PrimaryKeyConstraint('router_id'))
|
||||
op.add_column(
|
||||
u'nsxrouterextattributess',
|
||||
sa.Column('service_router', sa.Boolean(), nullable=False))
|
||||
op.execute("UPDATE nsxrouterextattributess set service_router=False")
|
||||
|
||||
|
||||
def downgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.drop_column(u'nsxrouterextattributess', 'service_router')
|
||||
op.drop_table('vcns_router_bindings')
|
@ -16,7 +16,7 @@
|
||||
"""nsx_mappings
|
||||
|
||||
Revision ID: 50e86cb2637a
|
||||
Revises: havana
|
||||
Revises: 1fcfc149aca4
|
||||
Create Date: 2013-10-26 14:37:30.012149
|
||||
|
||||
"""
|
||||
@ -62,4 +62,4 @@ def upgrade(active_plugins=None, options=None):
|
||||
|
||||
|
||||
def downgrade(active_plugins=None, options=None):
|
||||
pass
|
||||
pass
|
||||
|
@ -1,83 +0,0 @@
|
||||
# Copyright 2013 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
"""Add agent management extension model support
|
||||
|
||||
Revision ID: 511471cc46b
|
||||
Revises: 363468ac592c
|
||||
Create Date: 2013-02-18 05:09:32.523460
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '511471cc46b'
|
||||
down_revision = '363468ac592c'
|
||||
|
||||
# Change to ['*'] if this migration applies to all plugins
|
||||
|
||||
migration_for_plugins = [
|
||||
'neutron.plugins.brocade.NeutronPlugin.BrocadePluginV2',
|
||||
'neutron.plugins.linuxbridge.lb_neutron_plugin.LinuxBridgePluginV2',
|
||||
'neutron.plugins.openvswitch.ovs_neutron_plugin.OVSNeutronPluginV2',
|
||||
'neutron.plugins.nec.nec_plugin.NECPluginV2',
|
||||
'neutron.plugins.nicira.NeutronPlugin.NvpPluginV2',
|
||||
'neutron.plugins.nicira.NeutronServicePlugin.NvpAdvancedPlugin',
|
||||
'neutron.plugins.vmware.plugin.NsxPlugin',
|
||||
'neutron.plugins.vmware.plugin.NsxServicePlugin',
|
||||
'neutron.services.loadbalancer.plugin.LoadBalancerPlugin',
|
||||
'neutron.plugins.ibm.sdnve_neutron_plugin.SdnvePluginV2',
|
||||
'neutron.plugins.oneconvergence.plugin.OneConvergencePluginV2',
|
||||
'neutron.plugins.mlnx.mlnx_plugin.MellanoxEswitchPlugin',
|
||||
'neutron.plugins.ml2.plugin.Ml2Plugin',
|
||||
'neutron.plugins.bigswitch.plugin.NeutronRestProxyV2',
|
||||
]
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
from neutron.db import migration
|
||||
|
||||
|
||||
def upgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table(
|
||||
'agents',
|
||||
sa.Column('id', sa.String(length=36), nullable=False),
|
||||
sa.Column('agent_type', sa.String(length=255), nullable=False),
|
||||
sa.Column('binary', sa.String(length=255), nullable=False),
|
||||
sa.Column('topic', sa.String(length=255), nullable=False),
|
||||
sa.Column('host', sa.String(length=255), nullable=False),
|
||||
sa.Column('admin_state_up', sa.Boolean(), nullable=False),
|
||||
sa.Column('created_at', sa.DateTime(), nullable=False),
|
||||
sa.Column('started_at', sa.DateTime(), nullable=False),
|
||||
sa.Column('heartbeat_timestamp', sa.DateTime(), nullable=False),
|
||||
sa.Column('description', sa.String(length=255), nullable=True),
|
||||
sa.Column('configurations', sa.String(length=4095), nullable=False),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_table('agents')
|
||||
### end Alembic commands ###
|
@ -1,68 +0,0 @@
|
||||
# Copyright 2013 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
"""Cisco Nexus ML2 mechanism driver
|
||||
|
||||
Revision ID: 51b4de912379
|
||||
Revises: 66a59a7f516
|
||||
Create Date: 2013-08-20 15:31:40.553634
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '51b4de912379'
|
||||
down_revision = '66a59a7f516'
|
||||
|
||||
migration_for_plugins = [
|
||||
'neutron.plugins.ml2.plugin.Ml2Plugin'
|
||||
]
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
from neutron.db import migration
|
||||
|
||||
|
||||
def upgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.create_table(
|
||||
'cisco_ml2_nexusport_bindings',
|
||||
sa.Column('binding_id', sa.Integer(), nullable=False),
|
||||
sa.Column('port_id', sa.String(length=255), nullable=True),
|
||||
sa.Column('vlan_id', sa.Integer(), autoincrement=False,
|
||||
nullable=False),
|
||||
sa.Column('switch_ip', sa.String(length=255), nullable=True),
|
||||
sa.Column('instance_id', sa.String(length=255), nullable=True),
|
||||
sa.PrimaryKeyConstraint('binding_id'),
|
||||
)
|
||||
op.create_table(
|
||||
'cisco_ml2_credentials',
|
||||
sa.Column('credential_id', sa.String(length=255), nullable=True),
|
||||
sa.Column('tenant_id', sa.String(length=255), nullable=False),
|
||||
sa.Column('credential_name', sa.String(length=255), nullable=False),
|
||||
sa.Column('user_name', sa.String(length=255), nullable=True),
|
||||
sa.Column('password', sa.String(length=255), nullable=True),
|
||||
sa.PrimaryKeyConstraint('tenant_id', 'credential_name'),
|
||||
)
|
||||
|
||||
|
||||
def downgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.drop_table('cisco_ml2_credentials')
|
||||
op.drop_table('cisco_ml2_nexusport_bindings')
|
@ -1,61 +0,0 @@
|
||||
# Copyright 2013 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
"""LBaaS Pool scheduler
|
||||
|
||||
Revision ID: 52c5e4a18807
|
||||
Revises: 2032abe8edac
|
||||
Create Date: 2013-06-14 03:23:47.815865
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '52c5e4a18807'
|
||||
down_revision = '2032abe8edac'
|
||||
|
||||
migration_for_plugins = [
|
||||
'neutron.services.loadbalancer.plugin.LoadBalancerPlugin',
|
||||
]
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
from neutron.db import migration
|
||||
|
||||
|
||||
def upgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table(
|
||||
'poolloadbalanceragentbindings',
|
||||
sa.Column('pool_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('agent_id', sa.String(length=36),
|
||||
nullable=False),
|
||||
sa.ForeignKeyConstraint(['agent_id'], ['agents.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.ForeignKeyConstraint(['pool_id'], ['pools.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('pool_id')
|
||||
)
|
||||
### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_table('poolloadbalanceragentbindings')
|
||||
### end Alembic commands ###
|
@ -1,64 +0,0 @@
|
||||
# Copyright 2013 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
"""Extra dhcp opts support
|
||||
|
||||
Revision ID: 53bbd27ec841
|
||||
Revises: 40dffbf4b549
|
||||
Create Date: 2013-05-09 15:36:50.485036
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '53bbd27ec841'
|
||||
down_revision = '40dffbf4b549'
|
||||
|
||||
# Change to ['*'] if this migration applies to all plugins
|
||||
|
||||
migration_for_plugins = [
|
||||
'neutron.plugins.openvswitch.ovs_neutron_plugin.OVSNeutronPluginV2',
|
||||
'neutron.plugins.ml2.plugin.Ml2Plugin',
|
||||
'neutron.plugins.bigswitch.plugin.NeutronRestProxyV2'
|
||||
]
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
from neutron.db import migration
|
||||
|
||||
|
||||
def upgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.create_table(
|
||||
'extradhcpopts',
|
||||
sa.Column('id', sa.String(length=36), nullable=False),
|
||||
sa.Column('port_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('opt_name', sa.String(length=64), nullable=False),
|
||||
sa.Column('opt_value', sa.String(length=255), nullable=False),
|
||||
sa.ForeignKeyConstraint(['port_id'], ['ports.id'], ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('id'),
|
||||
sa.UniqueConstraint('port_id', 'opt_name', name='uidx_portid_optname'))
|
||||
|
||||
|
||||
def downgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_table('extradhcpopts')
|
||||
### end Alembic commands ###
|
@ -1,155 +0,0 @@
|
||||
# Copyright 2013 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
"""'DB support for load balancing service
|
||||
|
||||
Revision ID: 54c2c487e913
|
||||
Revises: 38335592a0dc
|
||||
Create Date: 2013-02-04 16:32:32.048731
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '54c2c487e913'
|
||||
down_revision = '38335592a0dc'
|
||||
|
||||
# We need migration_for_plugins to be an empty list to avoid creating tables,
|
||||
# if there's no plugin that implements the LBaaS extension.
|
||||
|
||||
migration_for_plugins = []
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
from neutron.db import migration
|
||||
|
||||
lb_protocols = sa.Enum("HTTP", "HTTPS", "TCP", name="lb_protocols")
|
||||
sesssionpersistences_type = sa.Enum("SOURCE_IP", "HTTP_COOKIE", "APP_COOKIE",
|
||||
name="sesssionpersistences_type")
|
||||
pools_lb_method = sa.Enum("ROUND_ROBIN", "LEAST_CONNECTIONS", "SOURCE_IP",
|
||||
name="pools_lb_method")
|
||||
healthmontiors_type = sa.Enum("PING", "TCP", "HTTP", "HTTPS",
|
||||
name="healthmontiors_type")
|
||||
|
||||
|
||||
def upgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.create_table(
|
||||
u'vips',
|
||||
sa.Column(u'tenant_id', sa.String(255), nullable=True),
|
||||
sa.Column(u'id', sa.String(36), nullable=False),
|
||||
sa.Column(u'name', sa.String(255), nullable=True),
|
||||
sa.Column(u'description', sa.String(255), nullable=True),
|
||||
sa.Column(u'port_id', sa.String(36), nullable=True),
|
||||
sa.Column(u'protocol_port', sa.Integer(), nullable=False),
|
||||
sa.Column(u'protocol', lb_protocols, nullable=False),
|
||||
sa.Column(u'pool_id', sa.String(36), nullable=False),
|
||||
sa.Column(u'status', sa.String(16), nullable=False),
|
||||
sa.Column(u'admin_state_up', sa.Boolean(), nullable=False),
|
||||
sa.Column(u'connection_limit', sa.Integer(), nullable=True),
|
||||
sa.ForeignKeyConstraint(['port_id'], ['ports.id'], ),
|
||||
sa.UniqueConstraint('pool_id'),
|
||||
sa.PrimaryKeyConstraint(u'id')
|
||||
)
|
||||
op.create_table(
|
||||
u'poolmonitorassociations',
|
||||
sa.Column(u'pool_id', sa.String(36), nullable=False),
|
||||
sa.Column(u'monitor_id', sa.String(36), nullable=False),
|
||||
sa.ForeignKeyConstraint(['monitor_id'], [u'healthmonitors.id'], ),
|
||||
sa.ForeignKeyConstraint(['pool_id'], [u'pools.id'], ),
|
||||
sa.PrimaryKeyConstraint(u'pool_id', u'monitor_id')
|
||||
)
|
||||
op.create_table(
|
||||
u'sessionpersistences',
|
||||
sa.Column(u'vip_id', sa.String(36), nullable=False),
|
||||
sa.Column(u'type', sesssionpersistences_type, nullable=False),
|
||||
sa.Column(u'cookie_name', sa.String(1024), nullable=True),
|
||||
sa.ForeignKeyConstraint(['vip_id'], [u'vips.id'], ),
|
||||
sa.PrimaryKeyConstraint(u'vip_id')
|
||||
)
|
||||
op.create_table(
|
||||
u'pools',
|
||||
sa.Column(u'tenant_id', sa.String(255), nullable=True),
|
||||
sa.Column(u'id', sa.String(36), nullable=False),
|
||||
sa.Column(u'vip_id', sa.String(36), nullable=True),
|
||||
sa.Column(u'name', sa.String(255), nullable=True),
|
||||
sa.Column(u'description', sa.String(255), nullable=True),
|
||||
sa.Column(u'subnet_id', sa.String(36), nullable=False),
|
||||
sa.Column(u'protocol', lb_protocols, nullable=False),
|
||||
|
||||
sa.Column(u'lb_method', pools_lb_method, nullable=False),
|
||||
sa.Column(u'status', sa.String(16), nullable=False),
|
||||
sa.Column(u'admin_state_up', sa.Boolean(), nullable=False),
|
||||
sa.ForeignKeyConstraint(['vip_id'], [u'vips.id'], ),
|
||||
sa.PrimaryKeyConstraint(u'id')
|
||||
)
|
||||
op.create_table(
|
||||
u'healthmonitors',
|
||||
sa.Column(u'tenant_id', sa.String(255), nullable=True),
|
||||
sa.Column(u'id', sa.String(36), nullable=False),
|
||||
sa.Column(u'type', healthmontiors_type, nullable=False),
|
||||
sa.Column(u'delay', sa.Integer(), nullable=False),
|
||||
sa.Column(u'timeout', sa.Integer(), nullable=False),
|
||||
sa.Column(u'max_retries', sa.Integer(), nullable=False),
|
||||
sa.Column(u'http_method', sa.String(16), nullable=True),
|
||||
sa.Column(u'url_path', sa.String(255), nullable=True),
|
||||
sa.Column(u'expected_codes', sa.String(64), nullable=True),
|
||||
sa.Column(u'status', sa.String(16), nullable=False),
|
||||
sa.Column(u'admin_state_up', sa.Boolean(), nullable=False),
|
||||
sa.PrimaryKeyConstraint(u'id')
|
||||
)
|
||||
op.create_table(
|
||||
u'members',
|
||||
sa.Column(u'tenant_id', sa.String(255), nullable=True),
|
||||
sa.Column(u'id', sa.String(36), nullable=False),
|
||||
sa.Column(u'pool_id', sa.String(36), nullable=False),
|
||||
sa.Column(u'address', sa.String(64), nullable=False),
|
||||
sa.Column(u'protocol_port', sa.Integer(), nullable=False),
|
||||
sa.Column(u'weight', sa.Integer(), nullable=False),
|
||||
sa.Column(u'status', sa.String(16), nullable=False),
|
||||
sa.Column(u'admin_state_up', sa.Boolean(), nullable=False),
|
||||
sa.ForeignKeyConstraint(['pool_id'], [u'pools.id'], ),
|
||||
sa.PrimaryKeyConstraint(u'id')
|
||||
)
|
||||
op.create_table(
|
||||
u'poolstatisticss',
|
||||
sa.Column(u'pool_id', sa.String(36), nullable=False),
|
||||
sa.Column(u'bytes_in', sa.Integer(), nullable=False),
|
||||
sa.Column(u'bytes_out', sa.Integer(), nullable=False),
|
||||
sa.Column(u'active_connections', sa.Integer(), nullable=False),
|
||||
sa.Column(u'total_connections', sa.Integer(), nullable=False),
|
||||
sa.ForeignKeyConstraint(['pool_id'], [u'pools.id'], ),
|
||||
sa.PrimaryKeyConstraint(u'pool_id')
|
||||
)
|
||||
|
||||
|
||||
def downgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.drop_table(u'poolstatisticss')
|
||||
op.drop_table(u'members')
|
||||
op.drop_table(u'healthmonitors')
|
||||
healthmontiors_type.drop(op.get_bind(), checkfirst=False)
|
||||
op.drop_table(u'pools')
|
||||
lb_protocols.drop(op.get_bind(), checkfirst=False)
|
||||
pools_lb_method.drop(op.get_bind(), checkfirst=False)
|
||||
op.drop_table(u'sessionpersistences')
|
||||
sesssionpersistences_type.drop(op.get_bind(), checkfirst=False)
|
||||
op.drop_table(u'poolmonitorassociations')
|
||||
op.drop_table(u'vips')
|
||||
lb_protocols.drop(op.get_bind(), checkfirst=False)
|
@ -1,79 +0,0 @@
|
||||
# Copyright 2013 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
"""New service types framework (service providers)
|
||||
|
||||
Revision ID: 557edfc53098
|
||||
Revises: 52c5e4a18807
|
||||
Create Date: 2013-06-29 21:10:41.283358
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '557edfc53098'
|
||||
down_revision = '52c5e4a18807'
|
||||
|
||||
# Change to ['*'] if this migration applies to all plugins
|
||||
|
||||
migration_for_plugins = [
|
||||
'neutron.services.loadbalancer.plugin.LoadBalancerPlugin',
|
||||
]
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
from neutron.db import migration
|
||||
|
||||
|
||||
def upgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
op.create_table(
|
||||
'providerresourceassociations',
|
||||
sa.Column('provider_name', sa.String(length=255), nullable=False),
|
||||
sa.Column('resource_id', sa.String(length=36),
|
||||
nullable=False, unique=True),
|
||||
)
|
||||
|
||||
for table in ('servicedefinitions', 'servicetypes'):
|
||||
op.execute("DROP TABLE IF EXISTS %s" % table)
|
||||
|
||||
|
||||
def downgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
op.create_table(
|
||||
'servicetypes',
|
||||
sa.Column('id', sa.String(length=36), nullable=False),
|
||||
sa.Column('tenant_id', sa.String(length=255)),
|
||||
sa.Column('name', sa.String(255)),
|
||||
sa.Column('description', sa.String(255)),
|
||||
sa.Column('default', sa.Boolean(), nullable=False, default=False),
|
||||
sa.Column('num_instances', sa.Integer, default=0),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
op.create_table(
|
||||
'servicedefinitions',
|
||||
sa.Column('id', sa.String(length=36), nullable=False),
|
||||
sa.Column('service_class', sa.String(255)),
|
||||
sa.Column('plugin', sa.String(255)),
|
||||
sa.Column('driver', sa.String(255)),
|
||||
sa.Column('service_type_id', sa.String(36),
|
||||
sa.ForeignKey('servicetypes.id',
|
||||
ondelete='CASCADE')),
|
||||
sa.PrimaryKeyConstraint('id', 'service_class')
|
||||
)
|
||||
op.drop_table('providerresourceassociations')
|
@ -1,77 +0,0 @@
|
||||
# Copyright 2013 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
"""metering
|
||||
|
||||
Revision ID: 569e98a8132b
|
||||
Revises: 13de305df56e
|
||||
Create Date: 2013-07-17 15:38:36.254595
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '569e98a8132b'
|
||||
down_revision = 'f9263d6df56'
|
||||
|
||||
# Change to ['*'] if this migration applies to all plugins
|
||||
|
||||
migration_for_plugins = ['neutron.services.metering.metering_plugin.'
|
||||
'MeteringPlugin']
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
from neutron.db import migration
|
||||
|
||||
meteringlabels_direction = sa.Enum('ingress', 'egress',
|
||||
name='meteringlabels_direction')
|
||||
|
||||
|
||||
def downgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.drop_table('meteringlabelrules')
|
||||
meteringlabels_direction.drop(op.get_bind(), checkfirst=False)
|
||||
op.drop_table('meteringlabels')
|
||||
|
||||
|
||||
def upgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.create_table('meteringlabels',
|
||||
sa.Column('tenant_id', sa.String(length=255),
|
||||
nullable=True),
|
||||
sa.Column('id', sa.String(length=36), nullable=False),
|
||||
sa.Column('name', sa.String(length=255),
|
||||
nullable=True),
|
||||
sa.Column('description', sa.String(length=1024),
|
||||
nullable=True),
|
||||
sa.PrimaryKeyConstraint('id'))
|
||||
op.create_table('meteringlabelrules',
|
||||
sa.Column('id', sa.String(length=36), nullable=False),
|
||||
sa.Column('direction', meteringlabels_direction,
|
||||
nullable=True),
|
||||
sa.Column('remote_ip_prefix', sa.String(length=64),
|
||||
nullable=True),
|
||||
sa.Column('metering_label_id', sa.String(length=36),
|
||||
nullable=False),
|
||||
sa.Column('excluded', sa.Boolean(),
|
||||
autoincrement=False, nullable=True),
|
||||
sa.ForeignKeyConstraint(['metering_label_id'],
|
||||
['meteringlabels.id'],
|
||||
name='meteringlabelrules_ibfk_1'),
|
||||
sa.PrimaryKeyConstraint('id'))
|
@ -1,69 +0,0 @@
|
||||
# Copyright 2013 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
"""add tables for router rules support
|
||||
|
||||
Revision ID: 5918cbddab04
|
||||
Revises: 3cbf70257c28
|
||||
Create Date: 2013-06-16 02:20:07.024752
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '5918cbddab04'
|
||||
down_revision = '3cbf70257c28'
|
||||
|
||||
# Change to ['*'] if this migration applies to all plugins
|
||||
|
||||
migration_for_plugins = [
|
||||
'neutron.plugins.bigswitch.plugin.NeutronRestProxyV2'
|
||||
]
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
from neutron.db import migration
|
||||
|
||||
|
||||
def upgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.create_table('routerrules',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('source', sa.String(length=64), nullable=False),
|
||||
sa.Column('destination', sa.String(length=64),
|
||||
nullable=False),
|
||||
sa.Column('action', sa.String(length=10), nullable=False),
|
||||
sa.Column('router_id', sa.String(length=36),
|
||||
nullable=True),
|
||||
sa.ForeignKeyConstraint(['router_id'], ['routers.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('id'))
|
||||
op.create_table('nexthops',
|
||||
sa.Column('rule_id', sa.Integer(), nullable=False),
|
||||
sa.Column('nexthop', sa.String(length=64), nullable=False),
|
||||
sa.ForeignKeyConstraint(['rule_id'], ['routerrules.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('rule_id', 'nexthop'))
|
||||
|
||||
|
||||
def downgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.drop_table('nexthops')
|
||||
op.drop_table('routerrules')
|
@ -1,72 +0,0 @@
|
||||
# Copyright 2012 New Dream Network, LLC (DreamHost)
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
# @author: Mark McClain, DreamHost
|
||||
|
||||
"""ryu
|
||||
|
||||
This retroactively provides migration support for
|
||||
https://review.openstack.org/#/c/11204/
|
||||
|
||||
Revision ID: 5a875d0e5c
|
||||
Revises: 2c4af419145b
|
||||
Create Date: 2012-12-18 12:32:04.482477
|
||||
|
||||
"""
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '5a875d0e5c'
|
||||
down_revision = '2c4af419145b'
|
||||
|
||||
# Change to ['*'] if this migration applies to all plugins
|
||||
|
||||
migration_for_plugins = [
|
||||
'neutron.plugins.ryu.ryu_neutron_plugin.RyuNeutronPluginV2'
|
||||
]
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
from neutron.db import migration
|
||||
|
||||
|
||||
def upgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.create_table(
|
||||
'tunnelkeys',
|
||||
sa.Column('network_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('tunnel_key', sa.Integer(), autoincrement=False,
|
||||
nullable=False),
|
||||
sa.ForeignKeyConstraint(['network_id'], ['networks.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('tunnel_key')
|
||||
)
|
||||
|
||||
op.create_table(
|
||||
'tunnelkeylasts',
|
||||
sa.Column('last_key', sa.Integer(), autoincrement=False,
|
||||
nullable=False),
|
||||
sa.PrimaryKeyConstraint('last_key')
|
||||
)
|
||||
|
||||
|
||||
def downgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.drop_table('tunnelkeylasts')
|
||||
op.drop_table('tunnelkeys')
|
@ -1,82 +0,0 @@
|
||||
# Copyright 2013 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
"""ml2_initial
|
||||
|
||||
Revision ID: 5ac71e65402c
|
||||
Revises: 128e042a2b68
|
||||
Create Date: 2013-05-27 16:08:40.853821
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '5ac71e65402c'
|
||||
down_revision = '128e042a2b68'
|
||||
|
||||
# Change to ['*'] if this migration applies to all plugins
|
||||
|
||||
migration_for_plugins = [
|
||||
'neutron.plugins.ml2.plugin.Ml2Plugin'
|
||||
]
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
from neutron.db import migration
|
||||
|
||||
|
||||
def upgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table(
|
||||
'ml2_network_segments',
|
||||
sa.Column('id', sa.String(length=36), nullable=False),
|
||||
sa.Column('network_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('network_type', sa.String(length=32), nullable=False),
|
||||
sa.Column('physical_network', sa.String(length=64), nullable=True),
|
||||
sa.Column('segmentation_id', sa.Integer(), nullable=True),
|
||||
sa.ForeignKeyConstraint(['network_id'], ['networks.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
op.create_table(
|
||||
'ml2_vlan_allocations',
|
||||
sa.Column('physical_network', sa.String(length=64), nullable=False),
|
||||
sa.Column('vlan_id', sa.Integer(), autoincrement=False,
|
||||
nullable=False),
|
||||
sa.Column('allocated', sa.Boolean(), autoincrement=False,
|
||||
nullable=False),
|
||||
sa.PrimaryKeyConstraint('physical_network', 'vlan_id')
|
||||
)
|
||||
op.create_table(
|
||||
'ml2_flat_allocations',
|
||||
sa.Column('physical_network', sa.String(length=64), nullable=False),
|
||||
sa.PrimaryKeyConstraint('physical_network')
|
||||
)
|
||||
### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_table('ml2_network_segments')
|
||||
op.drop_table('ml2_flat_allocations')
|
||||
op.drop_table('ml2_vlan_allocations')
|
||||
### end Alembic commands ###
|
@ -1,62 +0,0 @@
|
||||
# Copyright 2013 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
"""Add unique constraint for id column of TunnelEndpoint
|
||||
|
||||
Revision ID: 63afba73813
|
||||
Revises: 3c6e57a23db4
|
||||
Create Date: 2013-04-30 13:53:31.717450
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '63afba73813'
|
||||
down_revision = '3c6e57a23db4'
|
||||
|
||||
# Change to ['*'] if this migration applies to all plugins
|
||||
|
||||
migration_for_plugins = [
|
||||
'neutron.plugins.openvswitch.ovs_neutron_plugin.OVSNeutronPluginV2',
|
||||
]
|
||||
|
||||
from alembic import op
|
||||
|
||||
from neutron.db import migration
|
||||
|
||||
|
||||
CONSTRAINT_NAME = 'uniq_ovs_tunnel_endpoints0id'
|
||||
TABLE_NAME = 'ovs_tunnel_endpoints'
|
||||
|
||||
|
||||
def upgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.create_unique_constraint(
|
||||
name=CONSTRAINT_NAME,
|
||||
source=TABLE_NAME,
|
||||
local_cols=['id']
|
||||
)
|
||||
|
||||
|
||||
def downgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.drop_constraint(
|
||||
CONSTRAINT_NAME,
|
||||
TABLE_NAME,
|
||||
type_='unique'
|
||||
)
|
@ -1,66 +0,0 @@
|
||||
# Copyright 2013 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
"""NEC OpenFlow Router
|
||||
|
||||
Revision ID: 66a59a7f516
|
||||
Revises: 32a65f71af51
|
||||
Create Date: 2013-09-03 22:16:31.446031
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '66a59a7f516'
|
||||
down_revision = '32a65f71af51'
|
||||
|
||||
# Change to ['*'] if this migration applies to all plugins
|
||||
|
||||
migration_for_plugins = [
|
||||
'neutron.plugins.nec.nec_plugin.NECPluginV2'
|
||||
]
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
from neutron.db import migration
|
||||
|
||||
|
||||
def upgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.create_table(
|
||||
'ofcroutermappings',
|
||||
sa.Column('ofc_id', sa.String(length=255), nullable=False),
|
||||
sa.Column('quantum_id', sa.String(length=36), nullable=False),
|
||||
sa.PrimaryKeyConstraint('quantum_id'),
|
||||
sa.UniqueConstraint('ofc_id'),
|
||||
)
|
||||
op.create_table(
|
||||
'routerproviders',
|
||||
sa.Column('provider', sa.String(length=255), nullable=True),
|
||||
sa.Column('router_id', sa.String(length=36), nullable=False),
|
||||
sa.ForeignKeyConstraint(['router_id'], ['routers.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('router_id'),
|
||||
)
|
||||
|
||||
|
||||
def downgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.drop_table('routerproviders')
|
||||
op.drop_table('ofcroutermappings')
|
@ -1,57 +0,0 @@
|
||||
# Copyright 2013 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
"""remove bigswitch port tracking table
|
||||
|
||||
Revision ID: 86cf4d88bd3
|
||||
Revises: 569e98a8132b
|
||||
Create Date: 2013-08-13 21:59:04.373496
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '86cf4d88bd3'
|
||||
down_revision = '569e98a8132b'
|
||||
|
||||
# Change to ['*'] if this migration applies to all plugins
|
||||
|
||||
migration_for_plugins = [
|
||||
'neutron.plugins.bigswitch.plugin.NeutronRestProxyV2'
|
||||
]
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
from neutron.db import migration
|
||||
|
||||
|
||||
def upgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.drop_table('portlocations')
|
||||
|
||||
|
||||
def downgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.create_table('portlocations',
|
||||
sa.Column('port_id', sa.String(length=255),
|
||||
primary_key=True, nullable=False),
|
||||
sa.Column('host_id',
|
||||
sa.String(length=255), nullable=False)
|
||||
)
|
@ -1,56 +0,0 @@
|
||||
# Copyright 2014 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
"""ryu plugin quota
|
||||
|
||||
Revision ID: 8f682276ee4
|
||||
Revises: ed93525fd003
|
||||
Create Date: 2014-01-07 15:47:17.349425
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '8f682276ee4'
|
||||
down_revision = 'ed93525fd003'
|
||||
|
||||
# Change to ['*'] if this migration applies to all plugins
|
||||
|
||||
migration_for_plugins = [
|
||||
'neutron.plugins.ryu.ryu_neutron_plugin.RyuNeutronPluginV2'
|
||||
]
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
from neutron.db import migration
|
||||
|
||||
|
||||
def upgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.create_table(
|
||||
'quotas',
|
||||
sa.Column('id', sa.String(length=36), nullable=False),
|
||||
sa.Column('tenant_id', sa.String(length=255), nullable=True),
|
||||
sa.Column('resource', sa.String(length=255), nullable=True),
|
||||
sa.Column('limit', sa.Integer(), nullable=True),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
|
||||
|
||||
def downgrade(active_plugins=None, options=None):
|
||||
pass
|
@ -1,58 +0,0 @@
|
||||
# Copyright 2013 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
"""Remove cisco_vlan_bindings table
|
||||
|
||||
Revision ID: b7a8863760e
|
||||
Revises: 3cabb850f4a5
|
||||
Create Date: 2013-07-03 19:15:19.143175
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'b7a8863760e'
|
||||
down_revision = '3cabb850f4a5'
|
||||
|
||||
# Change to ['*'] if this migration applies to all plugins
|
||||
|
||||
migration_for_plugins = [
|
||||
'neutron.plugins.cisco.network_plugin.PluginV2'
|
||||
]
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
from neutron.db import migration
|
||||
|
||||
|
||||
def upgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.drop_table('cisco_vlan_bindings')
|
||||
|
||||
|
||||
def downgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.create_table(
|
||||
'cisco_vlan_bindings',
|
||||
sa.Column('vlan_id', sa.Integer(), nullable=False),
|
||||
sa.Column('vlan_name', sa.String(length=255), nullable=True),
|
||||
sa.Column('network_id', sa.String(length=255), nullable=False),
|
||||
sa.PrimaryKeyConstraint('vlan_id')
|
||||
)
|
@ -1,148 +0,0 @@
|
||||
# Copyright 2013 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
"""Cisco N1KV tables
|
||||
|
||||
Revision ID: c88b6b5fea3
|
||||
Revises: 263772d65691
|
||||
Create Date: 2013-08-06 15:08:32.651975
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'c88b6b5fea3'
|
||||
down_revision = '263772d65691'
|
||||
|
||||
migration_for_plugins = [
|
||||
'neutron.plugins.cisco.network_plugin.PluginV2'
|
||||
]
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
from neutron.db import migration
|
||||
|
||||
vlan_type = sa.Enum('vlan', 'vxlan', name='vlan_type')
|
||||
network_type = sa.Enum('network', 'policy', name='network_type')
|
||||
|
||||
|
||||
def upgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.drop_column('cisco_credentials', 'tenant_id')
|
||||
op.add_column(
|
||||
'cisco_credentials',
|
||||
sa.Column('type', sa.String(length=255), nullable=True)
|
||||
)
|
||||
op.create_table(
|
||||
'cisco_policy_profiles',
|
||||
sa.Column('id', sa.String(length=36), nullable=False),
|
||||
sa.Column('name', sa.String(length=255), nullable=True),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
op.create_table(
|
||||
'cisco_n1kv_vmnetworks',
|
||||
sa.Column('name', sa.String(length=80), nullable=False),
|
||||
sa.Column('profile_id', sa.String(length=36), nullable=True),
|
||||
sa.Column('network_id', sa.String(length=36), nullable=True),
|
||||
sa.Column('port_count', sa.Integer(), autoincrement=False,
|
||||
nullable=True),
|
||||
sa.ForeignKeyConstraint(['profile_id'], ['cisco_policy_profiles.id']),
|
||||
sa.PrimaryKeyConstraint('name')
|
||||
)
|
||||
op.create_table(
|
||||
'cisco_n1kv_vxlan_allocations',
|
||||
sa.Column('vxlan_id', sa.Integer(), autoincrement=False,
|
||||
nullable=False),
|
||||
sa.Column('allocated', sa.Boolean(), autoincrement=False,
|
||||
nullable=False),
|
||||
sa.PrimaryKeyConstraint('vxlan_id')
|
||||
)
|
||||
op.create_table(
|
||||
'cisco_network_profiles',
|
||||
sa.Column('id', sa.String(length=36), nullable=False),
|
||||
sa.Column('name', sa.String(length=255), nullable=True),
|
||||
sa.Column('segment_type', vlan_type, nullable=False),
|
||||
sa.Column('segment_range', sa.String(length=255), nullable=True),
|
||||
sa.Column('multicast_ip_index', sa.Integer(), autoincrement=False,
|
||||
nullable=True),
|
||||
sa.Column('multicast_ip_range', sa.String(length=255), nullable=True),
|
||||
sa.Column('physical_network', sa.String(length=255), nullable=True),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
op.create_table(
|
||||
'cisco_n1kv_profile_bindings',
|
||||
sa.Column('profile_type', network_type, nullable=True),
|
||||
sa.Column('tenant_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('profile_id', sa.String(length=36), nullable=False),
|
||||
sa.PrimaryKeyConstraint('tenant_id', 'profile_id')
|
||||
)
|
||||
op.create_table(
|
||||
'cisco_n1kv_port_bindings',
|
||||
sa.Column('port_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('profile_id', sa.String(length=36), nullable=True),
|
||||
sa.ForeignKeyConstraint(['port_id'], ['ports.id'], ondelete='CASCADE'),
|
||||
sa.ForeignKeyConstraint(['profile_id'], ['cisco_policy_profiles.id']),
|
||||
sa.PrimaryKeyConstraint('port_id')
|
||||
)
|
||||
op.create_table(
|
||||
'cisco_n1kv_vlan_allocations',
|
||||
sa.Column('physical_network', sa.String(length=64), nullable=False),
|
||||
sa.Column('vlan_id',
|
||||
sa.Integer(),
|
||||
autoincrement=False,
|
||||
nullable=False),
|
||||
sa.Column('allocated',
|
||||
sa.Boolean(),
|
||||
autoincrement=False,
|
||||
nullable=False),
|
||||
sa.PrimaryKeyConstraint('physical_network', 'vlan_id')
|
||||
)
|
||||
op.create_table(
|
||||
'cisco_n1kv_network_bindings',
|
||||
sa.Column('network_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('network_type', sa.String(length=32), nullable=False),
|
||||
sa.Column('physical_network', sa.String(length=64), nullable=True),
|
||||
sa.Column('segmentation_id', sa.Integer(), autoincrement=False,
|
||||
nullable=True),
|
||||
sa.Column('multicast_ip', sa.String(length=32), nullable=True),
|
||||
sa.Column('profile_id', sa.String(length=36), nullable=True),
|
||||
sa.ForeignKeyConstraint(['network_id'], ['networks.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.ForeignKeyConstraint(['profile_id'], ['cisco_network_profiles.id']),
|
||||
sa.PrimaryKeyConstraint('network_id')
|
||||
)
|
||||
|
||||
|
||||
def downgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.drop_table('cisco_n1kv_network_bindings')
|
||||
op.drop_table('cisco_n1kv_vlan_allocations')
|
||||
op.drop_table('cisco_n1kv_port_bindings')
|
||||
op.drop_table('cisco_n1kv_profile_bindings')
|
||||
network_type.drop(op.get_bind(), checkfirst=False)
|
||||
op.drop_table('cisco_network_profiles')
|
||||
vlan_type.drop(op.get_bind(), checkfirst=False)
|
||||
op.drop_table('cisco_n1kv_vxlan_allocations')
|
||||
op.drop_table('cisco_n1kv_vmnetworks')
|
||||
op.drop_table('cisco_policy_profiles')
|
||||
op.drop_column('cisco_credentials', 'type')
|
||||
op.add_column(
|
||||
'cisco_credentials',
|
||||
sa.Column('tenant_id', sa.String(length=255), nullable=False)
|
||||
)
|
@ -1,60 +0,0 @@
|
||||
# Copyright 2013 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
"""Add cisco_provider_networks table
|
||||
|
||||
Revision ID: e6b16a30d97
|
||||
Revises: 557edfc53098
|
||||
Create Date: 2013-07-18 21:46:12.792504
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'e6b16a30d97'
|
||||
down_revision = '557edfc53098'
|
||||
|
||||
# Change to ['*'] if this migration applies to all plugins
|
||||
|
||||
migration_for_plugins = [
|
||||
'neutron.plugins.cisco.network_plugin.PluginV2'
|
||||
]
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
from neutron.db import migration
|
||||
|
||||
|
||||
def upgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.create_table(
|
||||
'cisco_provider_networks',
|
||||
sa.Column('network_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('network_type', sa.String(length=255), nullable=False),
|
||||
sa.Column('segmentation_id', sa.Integer(), nullable=False),
|
||||
sa.ForeignKeyConstraint(['network_id'], ['networks.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('network_id')
|
||||
)
|
||||
|
||||
|
||||
def downgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.drop_table('cisco_provider_networks')
|
@ -33,23 +33,12 @@ from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
from neutron.db import migration
|
||||
from neutron.db.migration.alembic_migrations import common_ext_ops
|
||||
|
||||
|
||||
def upgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
common_ext_ops.upgrade_l3()
|
||||
|
||||
op.create_table(
|
||||
'quotas',
|
||||
sa.Column('id', sa.String(length=36), nullable=False),
|
||||
sa.Column('tenant_id', sa.String(length=255), nullable=True),
|
||||
sa.Column('resource', sa.String(length=255), nullable=True),
|
||||
sa.Column('limit', sa.Integer(), nullable=True),
|
||||
sa.PrimaryKeyConstraint('id'),
|
||||
)
|
||||
op.create_table(
|
||||
'net_partitions',
|
||||
sa.Column('id', sa.String(length=36), nullable=False),
|
||||
@ -77,10 +66,10 @@ def upgrade(active_plugins=None, options=None):
|
||||
nullable=True),
|
||||
sa.Column('nuage_user_id', sa.String(length=36), nullable=True),
|
||||
sa.Column('nuage_group_id', sa.String(length=36), nullable=True),
|
||||
sa.ForeignKeyConstraint(['net_partition_id'], ['net_partitions.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.ForeignKeyConstraint(['subnet_id'], ['subnets.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.ForeignKeyConstraint(['net_partition_id'], ['net_partitions.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('subnet_id'),
|
||||
)
|
||||
op.create_table(
|
||||
@ -92,7 +81,7 @@ def upgrade(active_plugins=None, options=None):
|
||||
ondelete='CASCADE'),
|
||||
sa.ForeignKeyConstraint(['router_id'], ['routers.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('router_id'),
|
||||
sa.PrimaryKeyConstraint('net_partition_id', 'router_id'),
|
||||
)
|
||||
op.create_table(
|
||||
'router_zone_mapping',
|
||||
@ -107,4 +96,4 @@ def upgrade(active_plugins=None, options=None):
|
||||
|
||||
|
||||
def downgrade(active_plugins=None, options=None):
|
||||
pass
|
||||
pass
|
||||
|
@ -1,57 +0,0 @@
|
||||
# Copyright 2014 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
"""bigswitch_quota
|
||||
|
||||
Revision ID: ed93525fd003
|
||||
Revises: 50e86cb2637a
|
||||
Create Date: 2014-01-05 10:59:19.860397
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'ed93525fd003'
|
||||
down_revision = '50e86cb2637a'
|
||||
|
||||
# Change to ['*'] if this migration applies to all plugins
|
||||
|
||||
migration_for_plugins = [
|
||||
'neutron.plugins.bigswitch.plugin.NeutronRestProxyV2'
|
||||
]
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
from neutron.db import migration
|
||||
|
||||
|
||||
def upgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table(
|
||||
'quotas',
|
||||
sa.Column('id', sa.String(length=36), nullable=False),
|
||||
sa.Column('tenant_id', sa.String(length=255), nullable=True),
|
||||
sa.Column('resource', sa.String(length=255), nullable=True),
|
||||
sa.Column('limit', sa.Integer(), nullable=True),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade(active_plugins=None, options=None):
|
||||
pass
|
@ -1,152 +0,0 @@
|
||||
# Copyright 2013 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
"""DB support for load balancing service (havana)
|
||||
|
||||
Revision ID: f489cf14a79c
|
||||
Revises: grizzly
|
||||
Create Date: 2013-02-04 16:32:32.048731
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'f489cf14a79c'
|
||||
down_revision = 'grizzly'
|
||||
|
||||
migration_for_plugins = [
|
||||
'neutron.services.loadbalancer.plugin.LoadBalancerPlugin',
|
||||
]
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
from neutron.db import migration
|
||||
|
||||
lb_protocols = sa.Enum("HTTP", "HTTPS", "TCP", name="lb_protocols")
|
||||
|
||||
sesssionpersistences_type = sa.Enum("SOURCE_IP", "HTTP_COOKIE", "APP_COOKIE",
|
||||
name="sesssionpersistences_type")
|
||||
pools_lb_method = sa.Enum("ROUND_ROBIN", "LEAST_CONNECTIONS", "SOURCE_IP",
|
||||
name="pools_lb_method")
|
||||
healthmonitors_type = sa.Enum("PING", "TCP", "HTTP", "HTTPS",
|
||||
name="healthmontiors_type")
|
||||
|
||||
|
||||
def upgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.create_table(
|
||||
u'vips',
|
||||
sa.Column(u'tenant_id', sa.String(255), nullable=True),
|
||||
sa.Column(u'id', sa.String(36), nullable=False),
|
||||
sa.Column(u'name', sa.String(255), nullable=True),
|
||||
sa.Column(u'description', sa.String(255), nullable=True),
|
||||
sa.Column(u'port_id', sa.String(36), nullable=True),
|
||||
sa.Column(u'protocol_port', sa.Integer(), nullable=False),
|
||||
sa.Column(u'protocol', lb_protocols, nullable=False),
|
||||
sa.Column(u'pool_id', sa.String(36), nullable=False),
|
||||
sa.Column(u'status', sa.String(16), nullable=False),
|
||||
sa.Column(u'admin_state_up', sa.Boolean(), nullable=False),
|
||||
sa.Column(u'connection_limit', sa.Integer(), nullable=True),
|
||||
sa.ForeignKeyConstraint(['port_id'], ['ports.id'], ),
|
||||
sa.UniqueConstraint('pool_id'),
|
||||
sa.PrimaryKeyConstraint(u'id')
|
||||
)
|
||||
op.create_table(
|
||||
u'sessionpersistences',
|
||||
sa.Column(u'vip_id', sa.String(36), nullable=False),
|
||||
sa.Column(u'type', sesssionpersistences_type, nullable=False),
|
||||
sa.Column(u'cookie_name', sa.String(1024), nullable=True),
|
||||
sa.ForeignKeyConstraint(['vip_id'], [u'vips.id'], ),
|
||||
sa.PrimaryKeyConstraint(u'vip_id')
|
||||
)
|
||||
op.create_table(
|
||||
u'pools',
|
||||
sa.Column(u'tenant_id', sa.String(255), nullable=True),
|
||||
sa.Column(u'id', sa.String(36), nullable=False),
|
||||
sa.Column(u'vip_id', sa.String(36), nullable=True),
|
||||
sa.Column(u'name', sa.String(255), nullable=True),
|
||||
sa.Column(u'description', sa.String(255), nullable=True),
|
||||
sa.Column(u'subnet_id', sa.String(36), nullable=False),
|
||||
sa.Column(u'protocol', lb_protocols, nullable=False),
|
||||
sa.Column(u'lb_method', pools_lb_method, nullable=False),
|
||||
sa.Column(u'status', sa.String(16), nullable=False),
|
||||
sa.Column(u'admin_state_up', sa.Boolean(), nullable=False),
|
||||
sa.ForeignKeyConstraint(['vip_id'], [u'vips.id'], ),
|
||||
sa.PrimaryKeyConstraint(u'id')
|
||||
)
|
||||
op.create_table(
|
||||
u'healthmonitors',
|
||||
sa.Column(u'tenant_id', sa.String(255), nullable=True),
|
||||
sa.Column(u'id', sa.String(36), nullable=False),
|
||||
sa.Column(u'type', healthmonitors_type, nullable=False),
|
||||
sa.Column(u'delay', sa.Integer(), nullable=False),
|
||||
sa.Column(u'timeout', sa.Integer(), nullable=False),
|
||||
sa.Column(u'max_retries', sa.Integer(), nullable=False),
|
||||
sa.Column(u'http_method', sa.String(16), nullable=True),
|
||||
sa.Column(u'url_path', sa.String(255), nullable=True),
|
||||
sa.Column(u'expected_codes', sa.String(64), nullable=True),
|
||||
sa.Column(u'status', sa.String(16), nullable=False),
|
||||
sa.Column(u'admin_state_up', sa.Boolean(), nullable=False),
|
||||
sa.PrimaryKeyConstraint(u'id')
|
||||
)
|
||||
op.create_table(
|
||||
u'poolmonitorassociations',
|
||||
sa.Column(u'pool_id', sa.String(36), nullable=False),
|
||||
sa.Column(u'monitor_id', sa.String(36), nullable=False),
|
||||
sa.ForeignKeyConstraint(['monitor_id'], [u'healthmonitors.id'], ),
|
||||
sa.ForeignKeyConstraint(['pool_id'], [u'pools.id'], ),
|
||||
sa.PrimaryKeyConstraint(u'pool_id', u'monitor_id')
|
||||
)
|
||||
op.create_table(
|
||||
u'members',
|
||||
sa.Column(u'tenant_id', sa.String(255), nullable=True),
|
||||
sa.Column(u'id', sa.String(36), nullable=False),
|
||||
sa.Column(u'pool_id', sa.String(36), nullable=False),
|
||||
sa.Column(u'address', sa.String(64), nullable=False),
|
||||
sa.Column(u'protocol_port', sa.Integer(), nullable=False),
|
||||
sa.Column(u'weight', sa.Integer(), nullable=False),
|
||||
sa.Column(u'status', sa.String(16), nullable=False),
|
||||
sa.Column(u'admin_state_up', sa.Boolean(), nullable=False),
|
||||
sa.ForeignKeyConstraint(['pool_id'], [u'pools.id'], ),
|
||||
sa.PrimaryKeyConstraint(u'id')
|
||||
)
|
||||
op.create_table(
|
||||
u'poolstatisticss',
|
||||
sa.Column(u'pool_id', sa.String(36), nullable=False),
|
||||
sa.Column(u'bytes_in', sa.Integer(), nullable=False),
|
||||
sa.Column(u'bytes_out', sa.Integer(), nullable=False),
|
||||
sa.Column(u'active_connections', sa.Integer(), nullable=False),
|
||||
sa.Column(u'total_connections', sa.Integer(), nullable=False),
|
||||
sa.ForeignKeyConstraint(['pool_id'], [u'pools.id'], ),
|
||||
sa.PrimaryKeyConstraint(u'pool_id')
|
||||
)
|
||||
|
||||
|
||||
def downgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
op.drop_table(u'poolstatisticss')
|
||||
op.drop_table(u'members')
|
||||
op.drop_table(u'poolmonitorassociations')
|
||||
op.drop_table(u'healthmonitors')
|
||||
healthmonitors_type.drop(op.get_bind(), checkfirst=False)
|
||||
op.drop_table(u'pools')
|
||||
pools_lb_method.drop(op.get_bind(), checkfirst=False)
|
||||
op.drop_table(u'sessionpersistences')
|
||||
sesssionpersistences_type.drop(op.get_bind(), checkfirst=False)
|
||||
op.drop_table(u'vips')
|
||||
lb_protocols.drop(op.get_bind(), checkfirst=False)
|
@ -1,44 +0,0 @@
|
||||
# Copyright 2013 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
"""remove_dhcp_lease
|
||||
|
||||
Revision ID: f9263d6df56
|
||||
Revises: c88b6b5fea3
|
||||
Create Date: 2013-07-17 12:31:33.731197
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'f9263d6df56'
|
||||
down_revision = 'c88b6b5fea3'
|
||||
|
||||
# Change to ['*'] if this migration applies to all plugins
|
||||
|
||||
migration_for_plugins = [
|
||||
'*'
|
||||
]
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
def upgrade(active_plugins=None, options=None):
|
||||
op.drop_column('ipallocations', u'expiration')
|
||||
|
||||
|
||||
def downgrade(active_plugins=None, options=None):
|
||||
op.add_column('ipallocations', sa.Column(u'expiration', sa.DateTime(),
|
||||
nullable=True))
|
@ -1,55 +0,0 @@
|
||||
# Copyright 2014 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
"""bsn_addresspairs
|
||||
|
||||
Revision ID: fcac4c42e2cc
|
||||
Revises: 2eeaf963a447
|
||||
Create Date: 2014-02-23 12:56:00.402855
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'fcac4c42e2cc'
|
||||
down_revision = '2eeaf963a447'
|
||||
|
||||
# Change to ['*'] if this migration applies to all plugins
|
||||
|
||||
migration_for_plugins = [
|
||||
'neutron.plugins.bigswitch.plugin.NeutronRestProxyV2'
|
||||
]
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
from neutron.db import migration
|
||||
|
||||
|
||||
def upgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
op.create_table(
|
||||
'allowedaddresspairs',
|
||||
sa.Column('port_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('mac_address', sa.String(length=32), nullable=False),
|
||||
sa.Column('ip_address', sa.String(length=64), nullable=False),
|
||||
sa.ForeignKeyConstraint(['port_id'], ['ports.id'], ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('port_id', 'mac_address', 'ip_address'),
|
||||
)
|
||||
|
||||
|
||||
def downgrade(active_plugins=None, options=None):
|
||||
pass
|
@ -1,561 +0,0 @@
|
||||
# Copyright 2012 New Dream Network, LLC (DreamHost)
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
# @author Mark McClain (DreamHost)
|
||||
|
||||
"""folsom initial database
|
||||
|
||||
Revision ID: folsom
|
||||
Revises: None
|
||||
Create Date: 2012-12-03 09:14:50.579765
|
||||
|
||||
"""
|
||||
|
||||
PLUGINS = {
|
||||
'bigswitch': 'neutron.plugins.bigswitch.plugin.NeutronRestProxyV2',
|
||||
'brocade': 'neutron.plugins.brocade.NeutronPlugin.BrocadePluginV2',
|
||||
'cisco': 'neutron.plugins.cisco.network_plugin.PluginV2',
|
||||
'lbr': 'neutron.plugins.linuxbridge.lb_neutron_plugin.LinuxBridgePluginV2',
|
||||
'meta': 'neutron.plugins.metaplugin.meta_neutron_plugin.MetaPluginV2',
|
||||
'ml2': 'neutron.plugins.ml2.plugin.Ml2Plugin',
|
||||
'mlnx': 'neutron.plugins.mlnx.mlnx_plugin.MellanoxEswitchPlugin',
|
||||
'nec': 'neutron.plugins.nec.nec_plugin.NECPluginV2',
|
||||
'nvp': 'neutron.plugins.nicira.NeutronPlugin.NvpPluginV2',
|
||||
'ocnvsd': 'neutron.plugins.oneconvergence.plugin.OneConvergencePluginV2',
|
||||
'ovs': 'neutron.plugins.openvswitch.ovs_neutron_plugin.OVSNeutronPluginV2',
|
||||
'plumgrid': 'neutron.plugins.plumgrid.plumgrid_plugin.plumgrid_plugin.'
|
||||
'NeutronPluginPLUMgridV2',
|
||||
'ryu': 'neutron.plugins.ryu.ryu_neutron_plugin.RyuNeutronPluginV2',
|
||||
'ibm': 'neutron.plugins.ibm.sdnve_neutron_plugin.SdnvePluginV2',
|
||||
}
|
||||
|
||||
L3_CAPABLE = [
|
||||
PLUGINS['lbr'],
|
||||
PLUGINS['meta'],
|
||||
PLUGINS['ml2'],
|
||||
PLUGINS['mlnx'],
|
||||
PLUGINS['nec'],
|
||||
PLUGINS['ocnvsd'],
|
||||
PLUGINS['ovs'],
|
||||
PLUGINS['ryu'],
|
||||
PLUGINS['brocade'],
|
||||
PLUGINS['plumgrid'],
|
||||
PLUGINS['ibm'],
|
||||
]
|
||||
|
||||
FOLSOM_QUOTA = [
|
||||
PLUGINS['lbr'],
|
||||
PLUGINS['ml2'],
|
||||
PLUGINS['nvp'],
|
||||
PLUGINS['ocnvsd'],
|
||||
PLUGINS['ovs'],
|
||||
]
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'folsom'
|
||||
down_revision = None
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
from neutron.db import migration
|
||||
from neutron.db.migration.alembic_migrations import common_ext_ops
|
||||
# NOTE: This is a special migration that creates a Folsom compatible database.
|
||||
|
||||
|
||||
def upgrade(active_plugins=None, options=None):
|
||||
# general model
|
||||
upgrade_base()
|
||||
|
||||
if migration.should_run(active_plugins, L3_CAPABLE):
|
||||
common_ext_ops.upgrade_l3()
|
||||
|
||||
if migration.should_run(active_plugins, FOLSOM_QUOTA):
|
||||
common_ext_ops.upgrade_quota()
|
||||
|
||||
if PLUGINS['lbr'] in active_plugins:
|
||||
upgrade_linuxbridge()
|
||||
elif PLUGINS['ovs'] in active_plugins:
|
||||
upgrade_ovs()
|
||||
elif PLUGINS['cisco'] in active_plugins:
|
||||
upgrade_cisco()
|
||||
# Cisco plugin imports OVS models too
|
||||
upgrade_ovs()
|
||||
elif PLUGINS['meta'] in active_plugins:
|
||||
upgrade_meta()
|
||||
elif PLUGINS['nec'] in active_plugins:
|
||||
upgrade_nec()
|
||||
elif PLUGINS['ryu'] in active_plugins:
|
||||
upgrade_ryu()
|
||||
elif PLUGINS['brocade'] in active_plugins:
|
||||
upgrade_brocade()
|
||||
# Brocade plugin imports linux bridge models too
|
||||
upgrade_linuxbridge()
|
||||
|
||||
|
||||
def upgrade_base():
|
||||
op.create_table(
|
||||
'networks',
|
||||
sa.Column('tenant_id', sa.String(length=255), nullable=True),
|
||||
sa.Column('id', sa.String(length=36), nullable=False),
|
||||
sa.Column('name', sa.String(length=255), nullable=True),
|
||||
sa.Column('status', sa.String(length=16), nullable=True),
|
||||
sa.Column('admin_state_up', sa.Boolean(), nullable=True),
|
||||
sa.Column('shared', sa.Boolean(), nullable=True),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
|
||||
op.create_table(
|
||||
'subnets',
|
||||
sa.Column('tenant_id', sa.String(length=255), nullable=True),
|
||||
sa.Column('id', sa.String(length=36), nullable=False),
|
||||
sa.Column('name', sa.String(length=255), nullable=True),
|
||||
sa.Column('network_id', sa.String(length=36), nullable=True),
|
||||
sa.Column('ip_version', sa.Integer(), nullable=False),
|
||||
sa.Column('cidr', sa.String(length=64), nullable=False),
|
||||
sa.Column('gateway_ip', sa.String(length=64), nullable=True),
|
||||
sa.Column('enable_dhcp', sa.Boolean(), nullable=True),
|
||||
sa.Column('shared', sa.Boolean(), nullable=True),
|
||||
sa.ForeignKeyConstraint(['network_id'], ['networks.id'], ),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
|
||||
op.create_table(
|
||||
'ports',
|
||||
sa.Column('tenant_id', sa.String(length=255), nullable=True),
|
||||
sa.Column('id', sa.String(length=36), nullable=False),
|
||||
sa.Column('name', sa.String(length=255), nullable=True),
|
||||
sa.Column('network_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('mac_address', sa.String(length=32), nullable=False),
|
||||
sa.Column('admin_state_up', sa.Boolean(), nullable=False),
|
||||
sa.Column('status', sa.String(length=16), nullable=False),
|
||||
sa.Column('device_id', sa.String(length=255), nullable=False),
|
||||
sa.Column('device_owner', sa.String(length=255), nullable=False),
|
||||
sa.ForeignKeyConstraint(['network_id'], ['networks.id'], ),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
|
||||
op.create_table(
|
||||
'dnsnameservers',
|
||||
sa.Column('address', sa.String(length=128), nullable=False),
|
||||
sa.Column('subnet_id', sa.String(length=36), nullable=False),
|
||||
sa.ForeignKeyConstraint(['subnet_id'], ['subnets.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('address', 'subnet_id')
|
||||
)
|
||||
|
||||
op.create_table(
|
||||
'ipallocations',
|
||||
sa.Column('port_id', sa.String(length=36), nullable=True),
|
||||
sa.Column('ip_address', sa.String(length=64), nullable=False),
|
||||
sa.Column('subnet_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('network_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('expiration', sa.DateTime(), nullable=True),
|
||||
sa.ForeignKeyConstraint(['network_id'], ['networks.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.ForeignKeyConstraint(['port_id'], ['ports.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.ForeignKeyConstraint(['subnet_id'], ['subnets.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('ip_address', 'subnet_id', 'network_id')
|
||||
)
|
||||
|
||||
op.create_table(
|
||||
'routes',
|
||||
sa.Column('destination', sa.String(length=64), nullable=False),
|
||||
sa.Column('nexthop', sa.String(length=64), nullable=False),
|
||||
sa.Column('subnet_id', sa.String(length=36), nullable=False),
|
||||
sa.ForeignKeyConstraint(['subnet_id'], ['subnets.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('destination', 'nexthop', 'subnet_id')
|
||||
)
|
||||
|
||||
op.create_table(
|
||||
'ipallocationpools',
|
||||
sa.Column('id', sa.String(length=36), nullable=False),
|
||||
sa.Column('subnet_id', sa.String(length=36), nullable=True),
|
||||
sa.Column('first_ip', sa.String(length=64), nullable=False),
|
||||
sa.Column('last_ip', sa.String(length=64), nullable=False),
|
||||
sa.ForeignKeyConstraint(['subnet_id'], ['subnets.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
|
||||
op.create_table(
|
||||
'ipavailabilityranges',
|
||||
sa.Column('allocation_pool_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('first_ip', sa.String(length=64), nullable=False),
|
||||
sa.Column('last_ip', sa.String(length=64), nullable=False),
|
||||
sa.ForeignKeyConstraint(['allocation_pool_id'],
|
||||
['ipallocationpools.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('allocation_pool_id', 'first_ip', 'last_ip')
|
||||
)
|
||||
|
||||
|
||||
def upgrade_linuxbridge():
|
||||
op.create_table(
|
||||
'network_states',
|
||||
sa.Column('physical_network', sa.String(length=64), nullable=False),
|
||||
sa.Column('vlan_id', sa.Integer(), autoincrement=False,
|
||||
nullable=False),
|
||||
sa.Column('allocated', sa.Boolean(), nullable=False),
|
||||
sa.PrimaryKeyConstraint('physical_network', 'vlan_id')
|
||||
)
|
||||
|
||||
op.create_table(
|
||||
'network_bindings',
|
||||
sa.Column('network_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('physical_network', sa.String(length=64), nullable=True),
|
||||
sa.Column('vlan_id', sa.Integer(), autoincrement=False,
|
||||
nullable=False),
|
||||
sa.ForeignKeyConstraint(['network_id'], ['networks.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('network_id')
|
||||
)
|
||||
|
||||
|
||||
def upgrade_ovs():
|
||||
op.create_table(
|
||||
'ovs_tunnel_endpoints',
|
||||
sa.Column('ip_address', sa.String(length=64), nullable=False),
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.PrimaryKeyConstraint('ip_address')
|
||||
)
|
||||
|
||||
op.create_table(
|
||||
'ovs_tunnel_ips',
|
||||
sa.Column('ip_address', sa.String(length=255), nullable=False),
|
||||
sa.PrimaryKeyConstraint('ip_address')
|
||||
)
|
||||
|
||||
op.create_table(
|
||||
'ovs_vlan_allocations',
|
||||
sa.Column('physical_network', sa.String(length=64), nullable=False),
|
||||
sa.Column('vlan_id', sa.Integer(), autoincrement=False,
|
||||
nullable=False),
|
||||
sa.Column('allocated', sa.Boolean(), nullable=False),
|
||||
sa.PrimaryKeyConstraint('physical_network', 'vlan_id')
|
||||
)
|
||||
|
||||
op.create_table(
|
||||
'ovs_tunnel_allocations',
|
||||
sa.Column('tunnel_id', sa.Integer(), autoincrement=False,
|
||||
nullable=False),
|
||||
sa.Column('allocated', sa.Boolean(), nullable=False),
|
||||
sa.PrimaryKeyConstraint('tunnel_id')
|
||||
)
|
||||
|
||||
op.create_table(
|
||||
'ovs_network_bindings',
|
||||
sa.Column('network_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('network_type', sa.String(length=32), nullable=False),
|
||||
sa.Column('physical_network', sa.String(length=64), nullable=True),
|
||||
sa.Column('segmentation_id', sa.Integer(), nullable=True),
|
||||
sa.ForeignKeyConstraint(['network_id'], ['networks.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('network_id')
|
||||
)
|
||||
|
||||
|
||||
def upgrade_meta():
|
||||
op.create_table(
|
||||
'networkflavors',
|
||||
sa.Column('flavor', sa.String(length=255)),
|
||||
sa.Column('network_id', sa.String(length=36), nullable=False),
|
||||
sa.ForeignKeyConstraint(['network_id'], ['networks.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('network_id')
|
||||
)
|
||||
|
||||
op.create_table(
|
||||
'routerflavors',
|
||||
sa.Column('flavor', sa.String(length=255)),
|
||||
sa.Column('router_id', sa.String(length=36), nullable=False),
|
||||
sa.ForeignKeyConstraint(['router_id'], ['routers.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('router_id')
|
||||
)
|
||||
|
||||
|
||||
def upgrade_nec():
|
||||
op.create_table(
|
||||
'ofctenants',
|
||||
sa.Column('id', sa.String(length=36), nullable=False),
|
||||
sa.Column('quantum_id', sa.String(length=36), nullable=False),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
|
||||
op.create_table(
|
||||
'ofcnetworks',
|
||||
sa.Column('id', sa.String(length=36), nullable=False),
|
||||
sa.Column('quantum_id', sa.String(length=36), nullable=False),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
|
||||
op.create_table(
|
||||
'ofcports',
|
||||
sa.Column('id', sa.String(length=36), nullable=False),
|
||||
sa.Column('quantum_id', sa.String(length=36), nullable=False),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
|
||||
op.create_table(
|
||||
'ofcfilters',
|
||||
sa.Column('id', sa.String(length=36), nullable=False),
|
||||
sa.Column('quantum_id', sa.String(length=36), nullable=False),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
|
||||
op.create_table(
|
||||
'portinfos',
|
||||
sa.Column('id', sa.String(length=36), nullable=False),
|
||||
sa.Column('datapath_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('port_no', sa.Integer(), nullable=False),
|
||||
sa.Column('vlan_id', sa.Integer(), nullable=False),
|
||||
sa.Column('mac', sa.String(length=32), nullable=False),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
|
||||
op.create_table(
|
||||
'packetfilters',
|
||||
sa.Column('tenant_id', sa.String(length=255), nullable=True),
|
||||
sa.Column('id', sa.String(length=36), nullable=False),
|
||||
sa.Column('network_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('priority', sa.Integer(), nullable=False),
|
||||
sa.Column('action', sa.String(16), nullable=False),
|
||||
sa.Column('in_port', sa.String(36), nullable=False),
|
||||
sa.Column('src_mac', sa.String(32), nullable=False),
|
||||
sa.Column('dst_mac', sa.String(32), nullable=False),
|
||||
sa.Column('eth_type', sa.Integer(), nullable=False),
|
||||
sa.Column('src_cidr', sa.String(64), nullable=False),
|
||||
sa.Column('dst_cidr', sa.String(64), nullable=False),
|
||||
sa.Column('protocol', sa.String(16), nullable=False),
|
||||
sa.Column('src_port', sa.Integer(), nullable=False),
|
||||
sa.Column('dst_port', sa.Integer(), nullable=False),
|
||||
sa.Column('admin_state_up', sa.Boolean(), nullable=False),
|
||||
sa.Column('status', sa.String(16), nullable=False),
|
||||
sa.ForeignKeyConstraint(['network_id'], ['networks.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
|
||||
|
||||
def upgrade_ryu():
|
||||
op.create_table(
|
||||
'ofp_server',
|
||||
sa.Column('id', sa.Integer(), autoincrement=False, nullable=False),
|
||||
sa.Column('address', sa.String(255)),
|
||||
sa.Column('host_type', sa.String(255)),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
|
||||
|
||||
def upgrade_brocade():
|
||||
op.create_table(
|
||||
'brocadenetworks',
|
||||
sa.Column('id', sa.Integer(), autoincrement=False, nullable=False),
|
||||
sa.Column('vlan', sa.String(10)),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
|
||||
op.create_table(
|
||||
'brocadeports',
|
||||
sa.Column('port_id', sa.String(36), nullable=False),
|
||||
sa.Column('network_id', sa.String(36)),
|
||||
sa.Column('admin_state_up', sa.Boolean()),
|
||||
sa.Column('physical_interface', sa.String(36)),
|
||||
sa.Column('vlan_id', sa.String(10)),
|
||||
sa.Column('tenant_id', sa.String(36)),
|
||||
sa.PrimaryKeyConstraint('port_id')
|
||||
)
|
||||
|
||||
|
||||
def upgrade_cisco():
|
||||
op.create_table(
|
||||
'cisco_vlan_ids',
|
||||
sa.Column('vlan_id', sa.Integer(), autoincrement=True),
|
||||
sa.Column('vlan_used', sa.Boolean()),
|
||||
sa.PrimaryKeyConstraint('vlan_id')
|
||||
)
|
||||
|
||||
op.create_table(
|
||||
'cisco_vlan_bindings',
|
||||
sa.Column('vlan_id', sa.Integer(), autoincrement=True),
|
||||
sa.Column('vlan_name', sa.String(255)),
|
||||
sa.Column('network_id', sa.String(255), nullable=False),
|
||||
sa.PrimaryKeyConstraint('vlan_id')
|
||||
)
|
||||
|
||||
op.create_table(
|
||||
'portprofiles',
|
||||
sa.Column('uuid', sa.String(255), nullable=False),
|
||||
sa.Column('name', sa.String(255)),
|
||||
sa.Column('vlan_id', sa.Integer()),
|
||||
sa.Column('qos', sa.String(255)),
|
||||
sa.PrimaryKeyConstraint('uuid')
|
||||
)
|
||||
|
||||
op.create_table(
|
||||
'portprofile_bindings',
|
||||
sa.Column('id', sa.Integer(), autoincrement=True),
|
||||
sa.Column('tenant_id', sa.String(255)),
|
||||
sa.Column('port_id', sa.String(255), nullable=False),
|
||||
sa.Column('portprofile_id', sa.String(255), nullable=False),
|
||||
sa.Column('default', sa.Boolean()),
|
||||
sa.PrimaryKeyConstraint('id'),
|
||||
sa.ForeignKeyConstraint(['port_id'], ['ports.id'], ),
|
||||
sa.ForeignKeyConstraint(['portprofile_id'], ['portprofiles.uuid'], ),
|
||||
)
|
||||
|
||||
op.create_table(
|
||||
'qoss', # yes two S's
|
||||
sa.Column('qos_id', sa.String(255)),
|
||||
sa.Column('tenant_id', sa.String(255)),
|
||||
sa.Column('qos_name', sa.String(255)),
|
||||
sa.Column('qos_desc', sa.String(255)),
|
||||
sa.PrimaryKeyConstraint('tenant_id', 'qos_name')
|
||||
)
|
||||
|
||||
op.create_table(
|
||||
'credentials',
|
||||
sa.Column('credential_id', sa.String(255)),
|
||||
sa.Column('tenant_id', sa.String(255)),
|
||||
sa.Column('credential_name', sa.String(255)),
|
||||
sa.Column('user_name', sa.String(255)),
|
||||
sa.Column('password', sa.String(255)),
|
||||
sa.PrimaryKeyConstraint('tenant_id', 'credential_name')
|
||||
)
|
||||
|
||||
op.create_table(
|
||||
'port_bindings',
|
||||
sa.Column('id', sa.Integer(), autoincrement=True),
|
||||
sa.Column('port_id', sa.String(255), nullable=False),
|
||||
sa.Column('blade_intf_dn', sa.String(255), nullable=False),
|
||||
sa.Column('portprofile_name', sa.String(255)),
|
||||
sa.Column('vlan_name', sa.String(255)),
|
||||
sa.Column('vlan_id', sa.Integer()),
|
||||
sa.Column('qos', sa.String(255)),
|
||||
sa.Column('tenant_id', sa.String(255)),
|
||||
sa.Column('instance_id', sa.String(255)),
|
||||
sa.Column('vif_id', sa.String(255)),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
|
||||
op.create_table(
|
||||
'nexusport_bindings',
|
||||
sa.Column('id', sa.Integer(), primary_key=True, autoincrement=True),
|
||||
sa.Column('port_id', sa.String(255)),
|
||||
sa.Column('vlan_id', sa.Integer()),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
|
||||
|
||||
def downgrade(active_plugins=None, options=None):
|
||||
if PLUGINS['lbr'] in active_plugins:
|
||||
downgrade_linuxbridge()
|
||||
elif PLUGINS['ovs'] in active_plugins:
|
||||
downgrade_ovs()
|
||||
elif PLUGINS['cisco'] in active_plugins:
|
||||
# Cisco plugin imports OVS models too
|
||||
downgrade_ovs()
|
||||
downgrade_cisco()
|
||||
elif PLUGINS['meta'] in active_plugins:
|
||||
downgrade_meta()
|
||||
elif PLUGINS['nec'] in active_plugins:
|
||||
downgrade_nec()
|
||||
elif PLUGINS['ryu'] in active_plugins:
|
||||
downgrade_ryu()
|
||||
elif PLUGINS['brocade'] in active_plugins:
|
||||
# Brocade plugin imports linux bridge models too
|
||||
downgrade_brocade()
|
||||
downgrade_linuxbridge()
|
||||
|
||||
if migration.should_run(active_plugins, FOLSOM_QUOTA):
|
||||
common_ext_ops.downgrade_quota()
|
||||
|
||||
if migration.should_run(active_plugins, L3_CAPABLE):
|
||||
common_ext_ops.downgrade_l3()
|
||||
|
||||
downgrade_base()
|
||||
|
||||
|
||||
def downgrade_base():
|
||||
drop_tables(
|
||||
'ipavailabilityranges',
|
||||
'ipallocationpools',
|
||||
'routes',
|
||||
'ipallocations',
|
||||
'dnsnameservers',
|
||||
'ports',
|
||||
'subnets',
|
||||
'networks'
|
||||
)
|
||||
|
||||
|
||||
def downgrade_linuxbridge():
|
||||
drop_tables('network_bindings', 'network_states')
|
||||
|
||||
|
||||
def downgrade_ovs():
|
||||
drop_tables(
|
||||
'ovs_network_bindings',
|
||||
'ovs_tunnel_allocations',
|
||||
'ovs_vlan_allocations',
|
||||
'ovs_tunnel_ips',
|
||||
'ovs_tunnel_endpoints'
|
||||
)
|
||||
|
||||
|
||||
def downgrade_meta():
|
||||
drop_tables('routerflavors', 'networkflavors')
|
||||
|
||||
|
||||
def downgrade_nec():
|
||||
drop_tables(
|
||||
'packetfilters',
|
||||
'portinfos',
|
||||
'ofcfilters',
|
||||
'ofcports',
|
||||
'ofcnetworks',
|
||||
'ofctenants'
|
||||
)
|
||||
|
||||
|
||||
def downgrade_ryu():
|
||||
op.drop_table('ofp_server')
|
||||
|
||||
|
||||
def downgrade_brocade():
|
||||
op.drop_table('brocadenetworks')
|
||||
op.drop_table('brocadeports')
|
||||
|
||||
|
||||
def downgrade_cisco():
|
||||
drop_tables(
|
||||
'nexusport_bindings',
|
||||
'port_bindings',
|
||||
'credentials',
|
||||
'qoss',
|
||||
'portprofile_bindings',
|
||||
'portprofiles',
|
||||
'cisco_vlan_bindings',
|
||||
'cisco_vlan_ids'
|
||||
)
|
||||
|
||||
|
||||
def drop_tables(*tables):
|
||||
for table in tables:
|
||||
op.drop_table(table)
|
@ -1,40 +0,0 @@
|
||||
# Copyright 2013 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
"""grizzly
|
||||
|
||||
Revision ID: grizzly
|
||||
Revises: 1341ed32cc1e
|
||||
Create Date: 2013-03-12 23:59:59.000000
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'grizzly'
|
||||
down_revision = '1341ed32cc1e'
|
||||
|
||||
# Change to ['*'] if this migration applies to all plugins
|
||||
|
||||
migration_for_plugins = ['*']
|
||||
|
||||
|
||||
def upgrade(active_plugins=None, options=None):
|
||||
"""A no-op migration for marking the Grizzly release."""
|
||||
pass
|
||||
|
||||
|
||||
def downgrade(active_plugins=None, options=None):
|
||||
"""A no-op migration for marking the Grizzly release."""
|
||||
pass
|
@ -0,0 +1,93 @@
|
||||
# Copyright 2014 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
"""havana_initial
|
||||
|
||||
Revision ID: havana
|
||||
Revises: None
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'havana'
|
||||
down_revision = None
|
||||
|
||||
|
||||
from neutron.db.migration.alembic_migrations import agent_init_ops
|
||||
from neutron.db.migration.alembic_migrations import brocade_init_ops
|
||||
from neutron.db.migration.alembic_migrations import cisco_init_ops
|
||||
from neutron.db.migration.alembic_migrations import core_init_ops
|
||||
from neutron.db.migration.alembic_migrations import firewall_init_ops
|
||||
from neutron.db.migration.alembic_migrations import l3_init_ops
|
||||
from neutron.db.migration.alembic_migrations import lb_init_ops
|
||||
from neutron.db.migration.alembic_migrations import loadbalancer_init_ops
|
||||
from neutron.db.migration.alembic_migrations import metering_init_ops
|
||||
from neutron.db.migration.alembic_migrations import ml2_init_ops
|
||||
from neutron.db.migration.alembic_migrations import mlnx_init_ops
|
||||
from neutron.db.migration.alembic_migrations import nec_init_ops
|
||||
from neutron.db.migration.alembic_migrations import other_extensions_init_ops
|
||||
from neutron.db.migration.alembic_migrations import other_plugins_init_ops
|
||||
from neutron.db.migration.alembic_migrations import ovs_init_ops
|
||||
from neutron.db.migration.alembic_migrations import portsec_init_ops
|
||||
from neutron.db.migration.alembic_migrations import ryu_init_ops
|
||||
from neutron.db.migration.alembic_migrations import secgroup_init_ops
|
||||
from neutron.db.migration.alembic_migrations import vmware_init_ops
|
||||
from neutron.db.migration.alembic_migrations import vpn_init_ops
|
||||
|
||||
|
||||
def upgrade(active_plugins=None, options=None):
|
||||
agent_init_ops.upgrade()
|
||||
core_init_ops.upgrade()
|
||||
l3_init_ops.upgrade()
|
||||
secgroup_init_ops.upgrade()
|
||||
portsec_init_ops.upgrade()
|
||||
other_extensions_init_ops.upgrade()
|
||||
lb_init_ops.upgrade()
|
||||
ovs_init_ops.upgrade()
|
||||
ml2_init_ops.upgrade()
|
||||
firewall_init_ops.upgrade()
|
||||
loadbalancer_init_ops.upgrade()
|
||||
vpn_init_ops.upgrade()
|
||||
metering_init_ops.upgrade()
|
||||
brocade_init_ops.upgrade()
|
||||
cisco_init_ops.upgrade()
|
||||
mlnx_init_ops.upgrade()
|
||||
nec_init_ops.upgrade()
|
||||
other_plugins_init_ops.upgrade()
|
||||
ryu_init_ops.upgrade()
|
||||
vmware_init_ops.upgrade()
|
||||
|
||||
|
||||
def downgrade(active_plugins=None, options=None):
|
||||
vmware_init_ops.downgrade()
|
||||
ryu_init_ops.downgrade()
|
||||
other_plugins_init_ops.downgrade()
|
||||
nec_init_ops.downgrade()
|
||||
mlnx_init_ops.downgrade()
|
||||
cisco_init_ops.downgrade()
|
||||
brocade_init_ops.downgrade()
|
||||
metering_init_ops.downgrade()
|
||||
vpn_init_ops.downgrade()
|
||||
loadbalancer_init_ops.downgrade()
|
||||
firewall_init_ops.downgrade()
|
||||
ovs_init_ops.downgrade()
|
||||
ml2_init_ops.downgrade()
|
||||
lb_init_ops.downgrade()
|
||||
other_extensions_init_ops.downgrade()
|
||||
portsec_init_ops.downgrade()
|
||||
secgroup_init_ops.downgrade()
|
||||
l3_init_ops.downgrade()
|
||||
core_init_ops.downgrade()
|
||||
agent_init_ops.downgrade()
|
@ -1,40 +0,0 @@
|
||||
# Copyright 2013 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
"""havana
|
||||
|
||||
Revision ID: havana
|
||||
Revises: 40b0aff0302e
|
||||
Create Date: 2013-10-02 00:00:00.000000
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'havana'
|
||||
down_revision = '40b0aff0302e'
|
||||
|
||||
# Change to ['*'] if this migration applies to all plugins
|
||||
|
||||
migration_for_plugins = ['*']
|
||||
|
||||
|
||||
def upgrade(active_plugins=None, options=None):
|
||||
"""A no-op migration for marking the Havana release."""
|
||||
pass
|
||||
|
||||
|
||||
def downgrade(active_plugins=None, options=None):
|
||||
"""A no-op migration for marking the Havana release."""
|
||||
pass
|
205
neutron/db/migration/alembic_migrations/vmware_init_ops.py
Normal file
205
neutron/db/migration/alembic_migrations/vmware_init_ops.py
Normal file
@ -0,0 +1,205 @@
|
||||
# Copyright 2014 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
# Initial schema operations for VMware plugins
|
||||
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
net_binding_type = sa.Enum('flat', 'vlan', 'stt', 'gre', 'l3_ext',
|
||||
name='nvp_network_bindings_binding_type')
|
||||
l2gw_segmentation_type = sa.Enum('flat', 'vlan',
|
||||
name='networkconnections_segmentation_type')
|
||||
qos_marking = sa.Enum('untrusted', 'trusted', name='qosqueues_qos_marking')
|
||||
|
||||
|
||||
def upgrade():
|
||||
op.create_table(
|
||||
'quantum_nvp_port_mapping',
|
||||
sa.Column('quantum_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('nvp_id', sa.String(length=36), nullable=True),
|
||||
sa.ForeignKeyConstraint(['quantum_id'], ['ports.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('quantum_id'))
|
||||
|
||||
op.create_table(
|
||||
'nvp_network_bindings',
|
||||
sa.Column('network_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('binding_type', net_binding_type, nullable=False),
|
||||
sa.Column('phy_uuid', sa.String(length=36), nullable=True),
|
||||
sa.Column('vlan_id', sa.Integer(), autoincrement=False, nullable=True),
|
||||
sa.ForeignKeyConstraint(['network_id'], ['networks.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('network_id', 'binding_type',
|
||||
'phy_uuid', 'vlan_id'))
|
||||
|
||||
op.create_table(
|
||||
'nvp_multi_provider_networks',
|
||||
sa.Column('network_id', sa.String(length=36), nullable=False),
|
||||
sa.ForeignKeyConstraint(['network_id'], ['networks.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('network_id'))
|
||||
|
||||
op.create_table(
|
||||
'nsxrouterextattributess',
|
||||
sa.Column('router_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('distributed', sa.Boolean(), nullable=False),
|
||||
sa.Column('service_router', sa.Boolean(), nullable=False,
|
||||
server_default='0'),
|
||||
sa.ForeignKeyConstraint(['router_id'], ['routers.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('router_id'))
|
||||
|
||||
op.create_table(
|
||||
'vcns_router_bindings',
|
||||
sa.Column('status', sa.String(length=16), nullable=False),
|
||||
sa.Column('status_description', sa.String(length=255), nullable=True),
|
||||
sa.Column('router_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('edge_id', sa.String(length=16), nullable=True),
|
||||
sa.Column('lswitch_id', sa.String(length=36), nullable=False),
|
||||
sa.PrimaryKeyConstraint('router_id'))
|
||||
|
||||
op.create_table(
|
||||
'vcns_edge_pool_bindings',
|
||||
sa.Column('pool_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('edge_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('pool_vseid', sa.String(length=36), nullable=True),
|
||||
sa.ForeignKeyConstraint(['pool_id'], ['pools.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('pool_id', 'edge_id'))
|
||||
|
||||
op.create_table(
|
||||
'vcns_edge_monitor_bindings',
|
||||
sa.Column('monitor_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('edge_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('monitor_vseid', sa.String(length=36), nullable=True),
|
||||
sa.ForeignKeyConstraint(['monitor_id'], ['healthmonitors.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('monitor_id', 'edge_id'))
|
||||
|
||||
op.create_table(
|
||||
'vcns_firewall_rule_bindings',
|
||||
sa.Column('rule_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('edge_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('rule_vseid', sa.String(length=36), nullable=True),
|
||||
sa.ForeignKeyConstraint(['rule_id'], ['firewall_rules.id'], ),
|
||||
sa.PrimaryKeyConstraint('rule_id', 'edge_id'))
|
||||
|
||||
op.create_table(
|
||||
'vcns_edge_vip_bindings',
|
||||
sa.Column('vip_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('edge_id', sa.String(length=36), nullable=True),
|
||||
sa.Column('vip_vseid', sa.String(length=36), nullable=True),
|
||||
sa.Column('app_profileid', sa.String(length=36), nullable=True),
|
||||
sa.ForeignKeyConstraint(['vip_id'], ['vips.id'], ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('vip_id'))
|
||||
|
||||
op.create_table(
|
||||
'networkgateways',
|
||||
sa.Column('id', sa.String(length=36), nullable=False),
|
||||
sa.Column('name', sa.String(length=255), nullable=True),
|
||||
sa.Column('tenant_id', sa.String(length=36), nullable=True),
|
||||
sa.Column('default', sa.Boolean(), nullable=True),
|
||||
sa.PrimaryKeyConstraint('id'))
|
||||
|
||||
op.create_table(
|
||||
'networkgatewaydevices',
|
||||
sa.Column('id', sa.String(length=36), nullable=False),
|
||||
sa.Column('network_gateway_id', sa.String(length=36), nullable=True),
|
||||
sa.Column('interface_name', sa.String(length=64), nullable=True),
|
||||
sa.ForeignKeyConstraint(['network_gateway_id'],
|
||||
['networkgateways.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('id'))
|
||||
|
||||
op.create_table(
|
||||
'networkconnections',
|
||||
sa.Column('tenant_id', sa.String(length=255), nullable=True),
|
||||
sa.Column('network_gateway_id', sa.String(length=36), nullable=True),
|
||||
sa.Column('network_id', sa.String(length=36), nullable=True),
|
||||
sa.Column('segmentation_type', l2gw_segmentation_type, nullable=True),
|
||||
sa.Column('segmentation_id', sa.Integer(), nullable=True),
|
||||
sa.Column('port_id', sa.String(length=36), nullable=False),
|
||||
sa.ForeignKeyConstraint(['network_gateway_id'], ['networkgateways.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.ForeignKeyConstraint(['network_id'], ['networks.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.ForeignKeyConstraint(['port_id'], ['ports.id'], ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('port_id'),
|
||||
sa.UniqueConstraint('network_gateway_id', 'segmentation_type',
|
||||
'segmentation_id'))
|
||||
|
||||
op.create_table(
|
||||
'qosqueues',
|
||||
sa.Column('tenant_id', sa.String(length=255), nullable=True),
|
||||
sa.Column('id', sa.String(length=36), nullable=False),
|
||||
sa.Column('name', sa.String(length=255), nullable=True),
|
||||
sa.Column('default', sa.Boolean(), nullable=True),
|
||||
sa.Column('min', sa.Integer(), nullable=False),
|
||||
sa.Column('max', sa.Integer(), nullable=True),
|
||||
sa.Column('qos_marking', qos_marking, nullable=True),
|
||||
sa.Column('dscp', sa.Integer(), nullable=True),
|
||||
sa.PrimaryKeyConstraint('id'))
|
||||
|
||||
op.create_table(
|
||||
'networkqueuemappings',
|
||||
sa.Column('network_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('queue_id', sa.String(length=36), nullable=True),
|
||||
sa.ForeignKeyConstraint(['network_id'], ['networks.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.ForeignKeyConstraint(['queue_id'], ['qosqueues.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('network_id'))
|
||||
|
||||
op.create_table(
|
||||
'portqueuemappings',
|
||||
sa.Column('port_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('queue_id', sa.String(length=36), nullable=False),
|
||||
sa.ForeignKeyConstraint(['port_id'], ['ports.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.ForeignKeyConstraint(['queue_id'], ['qosqueues.id'], ),
|
||||
sa.PrimaryKeyConstraint('port_id', 'queue_id'))
|
||||
|
||||
op.create_table(
|
||||
'maclearningstates',
|
||||
sa.Column('port_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('mac_learning_enabled', sa.Boolean(), nullable=False),
|
||||
sa.ForeignKeyConstraint(['port_id'], ['ports.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('port_id'))
|
||||
|
||||
|
||||
def downgrade():
|
||||
op.drop_table('maclearningstates')
|
||||
op.drop_table('portqueuemappings')
|
||||
op.drop_table('networkqueuemappings')
|
||||
op.drop_table('qosqueues')
|
||||
op.drop_table('networkconnections')
|
||||
op.drop_table('networkgatewaydevices')
|
||||
op.drop_table('networkgateways')
|
||||
op.drop_table('vcns_edge_vip_bindings')
|
||||
op.drop_table('vcns_firewall_rule_bindings')
|
||||
op.drop_table('vcns_edge_monitor_bindings')
|
||||
op.drop_table('vcns_edge_pool_bindings')
|
||||
op.drop_table('vcns_router_bindings')
|
||||
op.drop_table('nsxrouterextattributess')
|
||||
op.drop_table('nvp_multi_provider_networks')
|
||||
op.drop_table('nvp_network_bindings')
|
||||
op.drop_table('quantum_nvp_port_mapping')
|
||||
l2gw_segmentation_type.drop(op.get_bind(), checkfirst=False)
|
||||
qos_marking.drop(op.get_bind(), checkfirst=False)
|
||||
net_binding_type.drop(op.get_bind(), checkfirst=False)
|
@ -1,4 +1,4 @@
|
||||
# Copyright 2013 OpenStack Foundation
|
||||
# Copyright 2014 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
@ -13,48 +13,47 @@
|
||||
# under the License.
|
||||
#
|
||||
|
||||
"""Support for VPNaaS
|
||||
# Initial schema operations for IPSEC VPN service plugin
|
||||
|
||||
Revision ID: 52ff27f7567a
|
||||
Revises: 39cf3f799352
|
||||
Create Date: 2013-07-14 23:04:13.395955
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '52ff27f7567a'
|
||||
down_revision = '39cf3f799352'
|
||||
|
||||
# Change to ['*'] if this migration applies to all plugins
|
||||
|
||||
migration_for_plugins = [
|
||||
'neutron.services.vpn.plugin.VPNDriverPlugin',
|
||||
]
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
from neutron.db import migration
|
||||
vpn_auth_algorithms = sa.Enum('sha1', name='vpn_auth_algorithms')
|
||||
vpn_encrypt_algorithms = sa.Enum('3des', 'aes-128', 'aes-256', 'aes-192',
|
||||
name='vpn_encrypt_algorithms')
|
||||
ike_phase1_mode = sa.Enum('main', name='ike_phase1_mode')
|
||||
vpn_lifetime_units = sa.Enum('seconds', 'kilobytes', name='vpn_lifetime_units')
|
||||
|
||||
auth_algorithms = sa.Enum('sha1', name='vpn_auth_algorithms')
|
||||
encryption_algorithms = sa.Enum('3des', 'aes-128', 'aes-256', 'aes-192',
|
||||
name='vpn_encrypt_algorithms')
|
||||
encapsulation_modes = sa.Enum('tunnel', 'transport',
|
||||
name='ipsec_encapsulations')
|
||||
lifetime_unit_types = sa.Enum('seconds', 'kilobytes',
|
||||
name='vpn_lifetime_units')
|
||||
transform_protocols = sa.Enum('esp', 'ah', 'ah-esp',
|
||||
name='ipsec_transform_protocols')
|
||||
pfs_types = sa.Enum('group2', 'group5', 'group14', name='vpn_pfs')
|
||||
phase1_negotiation_modes = sa.Enum('main', name='ike_phase1_mode')
|
||||
ike_versions = sa.Enum('v1', 'v2', name='ike_versions')
|
||||
vpn_pfs = sa.Enum('group2', 'group5', 'group14', name='vpn_pfs')
|
||||
ipsec_transform_protocols = sa.Enum('esp', 'ah', 'ah-esp',
|
||||
name='ipsec_transform_protocols')
|
||||
ipsec_encapsulations = sa.Enum('tunnel', 'transport',
|
||||
name='ipsec_encapsulations')
|
||||
vpn_dpd_actions = sa.Enum('hold', 'clear', 'restart', 'disabled',
|
||||
'restart-by-peer', name='vpn_dpd_actions')
|
||||
vpn_initiators = sa.Enum('bi-directional', 'response-only',
|
||||
name='vpn_initiators')
|
||||
initiator_types = sa.Enum('bi-directional', 'response-only',
|
||||
name='vpn_initiators')
|
||||
dpd_actions = sa.Enum('hold', 'clear', 'restart', 'disabled',
|
||||
'restart-by-peer', name='vpn_dpd_actions')
|
||||
|
||||
|
||||
def upgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
def upgrade():
|
||||
op.create_table(
|
||||
'ipsecpolicies',
|
||||
sa.Column('tenant_id', sa.String(length=255), nullable=True),
|
||||
sa.Column('id', sa.String(length=36), nullable=False),
|
||||
sa.Column('name', sa.String(length=255), nullable=True),
|
||||
sa.Column('description', sa.String(length=255), nullable=True),
|
||||
sa.Column('transform_protocol', transform_protocols, nullable=False),
|
||||
sa.Column('auth_algorithm', auth_algorithms, nullable=False),
|
||||
sa.Column('encryption_algorithm', encryption_algorithms,
|
||||
nullable=False),
|
||||
sa.Column('encapsulation_mode', encapsulation_modes, nullable=False),
|
||||
sa.Column('lifetime_units', lifetime_unit_types, nullable=False),
|
||||
sa.Column('lifetime_value', sa.Integer(), nullable=False),
|
||||
sa.Column('pfs', pfs_types, nullable=False),
|
||||
sa.PrimaryKeyConstraint('id'))
|
||||
|
||||
op.create_table(
|
||||
'ikepolicies',
|
||||
@ -62,39 +61,18 @@ def upgrade(active_plugins=None, options=None):
|
||||
sa.Column('id', sa.String(length=36), nullable=False),
|
||||
sa.Column('name', sa.String(length=255), nullable=True),
|
||||
sa.Column('description', sa.String(length=255), nullable=True),
|
||||
sa.Column(
|
||||
'auth_algorithm', vpn_auth_algorithms, nullable=False),
|
||||
sa.Column(
|
||||
'encryption_algorithm', vpn_encrypt_algorithms, nullable=False),
|
||||
sa.Column(
|
||||
'phase1_negotiation_mode', ike_phase1_mode, nullable=False),
|
||||
sa.Column(
|
||||
'lifetime_units', vpn_lifetime_units, nullable=False),
|
||||
sa.Column('auth_algorithm', auth_algorithms, nullable=False),
|
||||
sa.Column('encryption_algorithm', encryption_algorithms,
|
||||
nullable=False),
|
||||
sa.Column('phase1_negotiation_mode',
|
||||
phase1_negotiation_modes,
|
||||
nullable=False),
|
||||
sa.Column('lifetime_units', lifetime_unit_types, nullable=False),
|
||||
sa.Column('lifetime_value', sa.Integer(), nullable=False),
|
||||
sa.Column('ike_version', ike_versions, nullable=False),
|
||||
sa.Column('pfs', vpn_pfs, nullable=False),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
op.create_table(
|
||||
'ipsecpolicies',
|
||||
sa.Column('tenant_id', sa.String(length=255), nullable=True),
|
||||
sa.Column('id', sa.String(length=36), nullable=False),
|
||||
sa.Column('name', sa.String(length=255), nullable=True),
|
||||
sa.Column('description', sa.String(length=255), nullable=True),
|
||||
sa.Column('transform_protocol', ipsec_transform_protocols,
|
||||
nullable=False),
|
||||
sa.Column('auth_algorithm', vpn_auth_algorithms, nullable=False),
|
||||
sa.Column('encryption_algorithm', vpn_encrypt_algorithms,
|
||||
nullable=False),
|
||||
sa.Column(
|
||||
'encapsulation_mode', ipsec_encapsulations, nullable=False),
|
||||
sa.Column(
|
||||
'lifetime_units', vpn_lifetime_units, nullable=False),
|
||||
sa.Column(
|
||||
'lifetime_value', sa.Integer(), nullable=False),
|
||||
sa.Column('pfs', vpn_pfs, nullable=False),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
sa.Column('pfs', pfs_types, nullable=False),
|
||||
sa.PrimaryKeyConstraint('id'))
|
||||
|
||||
op.create_table(
|
||||
'vpnservices',
|
||||
sa.Column('tenant_id', sa.String(length=255), nullable=True),
|
||||
@ -105,26 +83,24 @@ def upgrade(active_plugins=None, options=None):
|
||||
sa.Column('admin_state_up', sa.Boolean(), nullable=False),
|
||||
sa.Column('subnet_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('router_id', sa.String(length=36), nullable=False),
|
||||
sa.ForeignKeyConstraint(['router_id'], ['routers.id'], ),
|
||||
sa.ForeignKeyConstraint(['subnet_id'], ['subnets.id'], ),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
sa.ForeignKeyConstraint(['router_id'], ['routers.id'], ),
|
||||
sa.PrimaryKeyConstraint('id'))
|
||||
|
||||
op.create_table(
|
||||
'ipsec_site_connections',
|
||||
sa.Column('tenant_id', sa.String(length=255), nullable=True),
|
||||
sa.Column('id', sa.String(length=36), nullable=False),
|
||||
sa.Column('name', sa.String(length=255), nullable=True),
|
||||
sa.Column('description', sa.String(length=255), nullable=True),
|
||||
sa.Column('peer_address', sa.String(length=64), nullable=False),
|
||||
sa.Column('peer_address', sa.String(length=255), nullable=False),
|
||||
sa.Column('peer_id', sa.String(length=255), nullable=False),
|
||||
sa.Column('route_mode', sa.String(length=8), nullable=False),
|
||||
sa.Column('mtu', sa.Integer(), nullable=False),
|
||||
sa.Column(
|
||||
'initiator', vpn_initiators, nullable=False),
|
||||
sa.Column('initiator', initiator_types, nullable=False),
|
||||
sa.Column('auth_mode', sa.String(length=16), nullable=False),
|
||||
sa.Column('psk', sa.String(length=255), nullable=False),
|
||||
sa.Column(
|
||||
'dpd_action', vpn_dpd_actions, nullable=False),
|
||||
sa.Column('dpd_action', dpd_actions, nullable=False),
|
||||
sa.Column('dpd_interval', sa.Integer(), nullable=False),
|
||||
sa.Column('dpd_timeout', sa.Integer(), nullable=False),
|
||||
sa.Column('status', sa.String(length=16), nullable=False),
|
||||
@ -132,40 +108,35 @@ def upgrade(active_plugins=None, options=None):
|
||||
sa.Column('vpnservice_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('ipsecpolicy_id', sa.String(length=36), nullable=False),
|
||||
sa.Column('ikepolicy_id', sa.String(length=36), nullable=False),
|
||||
sa.ForeignKeyConstraint(['ikepolicy_id'], ['ikepolicies.id']),
|
||||
sa.ForeignKeyConstraint(['ipsecpolicy_id'], ['ipsecpolicies.id']),
|
||||
sa.ForeignKeyConstraint(['vpnservice_id'], ['vpnservices.id']),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
sa.ForeignKeyConstraint(['vpnservice_id'], ['vpnservices.id'], ),
|
||||
sa.ForeignKeyConstraint(['ipsecpolicy_id'], ['ipsecpolicies.id'], ),
|
||||
sa.ForeignKeyConstraint(['ikepolicy_id'], ['ikepolicies.id'], ),
|
||||
sa.PrimaryKeyConstraint('id'))
|
||||
|
||||
op.create_table(
|
||||
'ipsecpeercidrs',
|
||||
sa.Column('cidr', sa.String(length=32), nullable=False),
|
||||
sa.Column('ipsec_site_connection_id',
|
||||
sa.String(length=36),
|
||||
sa.Column('ipsec_site_connection_id', sa.String(length=36),
|
||||
nullable=False),
|
||||
sa.ForeignKeyConstraint(['ipsec_site_connection_id'],
|
||||
['ipsec_site_connections.id'],
|
||||
ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('cidr', 'ipsec_site_connection_id')
|
||||
)
|
||||
sa.PrimaryKeyConstraint('cidr', 'ipsec_site_connection_id'))
|
||||
|
||||
|
||||
def downgrade(active_plugins=None, options=None):
|
||||
if not migration.should_run(active_plugins, migration_for_plugins):
|
||||
return
|
||||
|
||||
def downgrade():
|
||||
op.drop_table('ipsecpeercidrs')
|
||||
op.drop_table('ipsec_site_connections')
|
||||
vpn_dpd_actions.drop(op.get_bind(), checkfirst=False)
|
||||
vpn_initiators.drop(op.get_bind(), checkfirst=False)
|
||||
op.drop_table('vpnservices')
|
||||
op.drop_table('ipsecpolicies')
|
||||
ipsec_transform_protocols.drop(op.get_bind(), checkfirst=False)
|
||||
ipsec_encapsulations.drop(op.get_bind(), checkfirst=False)
|
||||
op.drop_table('ikepolicies')
|
||||
vpn_auth_algorithms.drop(op.get_bind(), checkfirst=False)
|
||||
vpn_encrypt_algorithms.drop(op.get_bind(), checkfirst=False)
|
||||
ike_phase1_mode.drop(op.get_bind(), checkfirst=False)
|
||||
vpn_lifetime_units.drop(op.get_bind(), checkfirst=False)
|
||||
op.drop_table('ipsecpolicies')
|
||||
auth_algorithms.drop(op.get_bind(), checkfirst=False)
|
||||
encryption_algorithms.drop(op.get_bind(), checkfirst=False)
|
||||
encapsulation_modes.drop(op.get_bind(), checkfirst=False)
|
||||
lifetime_unit_types.drop(op.get_bind(), checkfirst=False)
|
||||
transform_protocols.drop(op.get_bind(), checkfirst=False)
|
||||
pfs_types.drop(op.get_bind(), checkfirst=False)
|
||||
phase1_negotiation_modes.drop(op.get_bind(), checkfirst=False)
|
||||
ike_versions.drop(op.get_bind(), checkfirst=False)
|
||||
vpn_pfs.drop(op.get_bind(), checkfirst=False)
|
||||
initiator_types.drop(op.get_bind(), checkfirst=False)
|
||||
dpd_actions.drop(op.get_bind(), checkfirst=False)
|
Loading…
x
Reference in New Issue
Block a user