1 # Copyright 2015 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 # Initial operations for Nuage plugin
18 from alembic import op
19 import sqlalchemy as sa
25 'nuage_net_partitions',
26 sa.Column('id', sa.String(length=36), nullable=False),
27 sa.Column('name', sa.String(length=64), nullable=True),
28 sa.Column('l3dom_tmplt_id', sa.String(length=36), nullable=True),
29 sa.Column('l2dom_tmplt_id', sa.String(length=36), nullable=True),
30 sa.Column('isolated_zone', sa.String(length=64), nullable=True),
31 sa.Column('shared_zone', sa.String(length=64), nullable=True),
32 sa.PrimaryKeyConstraint('id'),
35 'nuage_subnet_l2dom_mapping',
36 sa.Column('subnet_id', sa.String(length=36), nullable=False),
37 sa.Column('net_partition_id', sa.String(length=36), nullable=True),
38 sa.Column('nuage_subnet_id', sa.String(length=36), nullable=True,
40 sa.Column('nuage_l2dom_tmplt_id', sa.String(length=36),
42 sa.Column('nuage_user_id', sa.String(length=36), nullable=True),
43 sa.Column('nuage_group_id', sa.String(length=36), nullable=True),
44 sa.Column('nuage_managed_subnet', sa.Boolean(), nullable=True),
45 sa.ForeignKeyConstraint(['subnet_id'], ['subnets.id'],
47 sa.ForeignKeyConstraint(['net_partition_id'],
48 ['nuage_net_partitions.id'],
50 sa.PrimaryKeyConstraint('subnet_id'),
53 'nuage_net_partition_router_mapping',
54 sa.Column('net_partition_id', sa.String(length=36), nullable=False),
55 sa.Column('router_id', sa.String(length=36), nullable=False),
56 sa.Column('nuage_router_id', sa.String(length=36), nullable=True,
58 sa.Column('nuage_rtr_rd', sa.String(length=36), nullable=True),
59 sa.Column('nuage_rtr_rt', sa.String(length=36), nullable=True),
60 sa.ForeignKeyConstraint(['net_partition_id'],
61 ['nuage_net_partitions.id'],
63 sa.ForeignKeyConstraint(['router_id'], ['routers.id'],
65 sa.PrimaryKeyConstraint('net_partition_id', 'router_id'),
68 'nuage_provider_net_bindings',
69 sa.Column('network_id', sa.String(length=36), nullable=False),
70 sa.Column('network_type', sa.String(length=32), nullable=False),
71 sa.Column('physical_network', sa.String(length=64), nullable=False),
72 sa.Column('vlan_id', sa.Integer(), nullable=False),
73 sa.ForeignKeyConstraint(
74 ['network_id'], ['networks.id'], ondelete='CASCADE'),
75 sa.PrimaryKeyConstraint('network_id')