1
# Copyright 2013 OpenStack Foundation
3
# Licensed under the Apache License, Version 2.0 (the "License"); you may
4
# not use this file except in compliance with the License. You may obtain
5
# a copy of the License at
7
# http://www.apache.org/licenses/LICENSE-2.0
9
# Unless required by applicable law or agreed to in writing, software
10
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12
# License for the specific language governing permissions and limitations
16
"""Cisco Nexus ML2 mechanism driver
18
Revision ID: 51b4de912379
20
Create Date: 2013-08-20 15:31:40.553634
24
# revision identifiers, used by Alembic.
25
revision = '51b4de912379'
26
down_revision = '66a59a7f516'
28
migration_for_plugins = [
29
'neutron.plugins.ml2.plugin.Ml2Plugin'
32
from alembic import op
33
import sqlalchemy as sa
35
from neutron.db import migration
38
def upgrade(active_plugins=None, options=None):
39
if not migration.should_run(active_plugins, migration_for_plugins):
43
'cisco_ml2_nexusport_bindings',
44
sa.Column('binding_id', sa.Integer(), nullable=False),
45
sa.Column('port_id', sa.String(length=255), nullable=True),
46
sa.Column('vlan_id', sa.Integer(), autoincrement=False,
48
sa.Column('switch_ip', sa.String(length=255), nullable=True),
49
sa.Column('instance_id', sa.String(length=255), nullable=True),
50
sa.PrimaryKeyConstraint('binding_id'),
53
'cisco_ml2_credentials',
54
sa.Column('credential_id', sa.String(length=255), nullable=True),
55
sa.Column('tenant_id', sa.String(length=255), nullable=False),
56
sa.Column('credential_name', sa.String(length=255), nullable=False),
57
sa.Column('user_name', sa.String(length=255), nullable=True),
58
sa.Column('password', sa.String(length=255), nullable=True),
59
sa.PrimaryKeyConstraint('tenant_id', 'credential_name'),
63
def downgrade(active_plugins=None, options=None):
64
if not migration.should_run(active_plugins, migration_for_plugins):
67
op.drop_table('cisco_ml2_credentials')
68
op.drop_table('cisco_ml2_nexusport_bindings')