Debian Codegraph @

networking_l2gw/db/migration/alembic_migrations/versions/42438454c556_l2gateway_models.py

raw symbols SCIP
1 # Copyright 2015 OpenStack Foundation
2 #
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
6 #
7 # http://www.apache.org/licenses/LICENSE-2.0
8 #
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
13 # under the License.
14 #
15
16 """l2gateway_models
17
18 Revision ID: 42438454c556
19 Revises: 54c9c8fe22bf
20 Create Date: 2014-11-27 01:57:56.997665
21
22 """
23
24 from alembic import op
25 import sqlalchemy as sa
26
27 # revision identifiers, used by Alembic.
28 revision = '42438454c556'
29 down_revision = '54c9c8fe22bf'
30
31
32 def upgrade():
33 op.create_table('l2gateways',
34 sa.Column('id', sa.String(length=36), nullable=False),
35 sa.Column('name', sa.String(length=255), nullable=True),
36 sa.Column('tenant_id', sa.String(length=255),
37 nullable=True),
38 sa.PrimaryKeyConstraint('id'))
39
40 op.create_table('l2gatewaydevices',
41 sa.Column('id', sa.String(length=36), nullable=False),
42 sa.Column('device_name', sa.String(length=255),
43 nullable=False),
44 sa.Column('l2_gateway_id', sa.String(length=36),
45 nullable=False),
46 sa.ForeignKeyConstraint(['l2_gateway_id'],
47 ['l2gateways.id'],
48 ondelete='CASCADE'),
49 sa.PrimaryKeyConstraint('id'))
50
51 op.create_table('l2gatewayinterfaces',
52 sa.Column('id', sa.String(length=36), nullable=False),
53 sa.Column('interface_name', sa.String(length=255),
54 nullable=True),
55 sa.Column('segmentation_id', sa.Integer(),
56 nullable=True),
57 sa.Column('device_id', sa.String(length=36),
58 nullable=False),
59 sa.ForeignKeyConstraint(['device_id'],
60 ['l2gatewaydevices.id'],
61 ondelete='CASCADE'),
62 sa.PrimaryKeyConstraint('id'))
63
64 op.create_table('l2gatewayconnections',
65 sa.Column('id', sa.String(length=36), nullable=False),
66 sa.Column('tenant_id', sa.String(length=255),
67 nullable=True),
68 sa.Column('l2_gateway_id', sa.String(length=36),
69 nullable=True),
70 sa.Column('network_id', sa.String(length=36),
71 nullable=False),
72 sa.Column('segmentation_id', sa.Integer(),
73 nullable=True),
74 sa.ForeignKeyConstraint(['l2_gateway_id'],
75 ['l2gateways.id'],
76 ondelete='CASCADE'),
77 sa.ForeignKeyConstraint(['network_id'], ['networks.id'],
78 ondelete='CASCADE'),
79 sa.UniqueConstraint('l2_gateway_id',
80 'network_id'),
81 sa.PrimaryKeyConstraint('id'))
82
83 op.create_table('pending_ucast_macs_remotes',
84 sa.Column('id', sa.String(length=36), nullable=False),
85 sa.Column('uuid', sa.String(length=36), nullable=True),
86 sa.Column('mac', sa.String(32), nullable=False),
87 sa.Column('logical_switch_uuid', sa.String(36),
88 nullable=False),
89 sa.Column('locator_uuid', sa.String(36),
90 nullable=True),
91 sa.Column('dst_ip', sa.String(64)),
92 sa.Column('vm_ip', sa.String(64)),
93 sa.Column('ovsdb_identifier', sa.String(64),
94 nullable=False),
95 sa.Column('operation', sa.String(8), nullable=False),
96 sa.Column('timestamp', sa.DateTime, nullable=False))