diff options
author | Ulas Kozat <ulas.kozat@huawei.com> | 2015-12-28 16:05:13 -0800 |
---|---|---|
committer | Ulas Kozat <ulas.kozat@huawei.com> | 2015-12-28 16:05:13 -0800 |
commit | c772a1dbc7ace58d099570d41a889adf851c8ba8 (patch) | |
tree | 809aefa0dae407a1d9c12989f7e8f60891700d17 /networking_sfc/db/migration/alembic_migrations/versions/liberty/expand/5a475fc853e6_ovs_data_model.py | |
parent | e671a915d887ae8f7751a54bb07ecb7ed8f2f25b (diff) |
Added networking-sfc from openstack project with merge date Dec 23 2015stable/coloradostable/brahmaputra
Added patch 13 for subject "add missing db migration files"
Change-Id: Id51a160335a14870c1dd816a44baf9b1958b9ac6
Diffstat (limited to 'networking_sfc/db/migration/alembic_migrations/versions/liberty/expand/5a475fc853e6_ovs_data_model.py')
-rw-r--r-- | networking_sfc/db/migration/alembic_migrations/versions/liberty/expand/5a475fc853e6_ovs_data_model.py | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/networking_sfc/db/migration/alembic_migrations/versions/liberty/expand/5a475fc853e6_ovs_data_model.py b/networking_sfc/db/migration/alembic_migrations/versions/liberty/expand/5a475fc853e6_ovs_data_model.py new file mode 100644 index 0000000..e257548 --- /dev/null +++ b/networking_sfc/db/migration/alembic_migrations/versions/liberty/expand/5a475fc853e6_ovs_data_model.py @@ -0,0 +1,87 @@ +# Copyright 2015 Futurewei. All rights reserved. +# +# 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. + +"""Defining OVS data-model + +Revision ID: 5a475fc853e6 +Revises: c3e178d4a985 +Create Date: 2015-09-30 18:00:57.758762 + +""" + +from alembic import op +import sqlalchemy as sa + + +# revision identifiers, used by Alembic. +revision = '5a475fc853e6' +down_revision = 'c3e178d4a985' + + +def upgrade(): + op.create_table('sfc_portpair_details', + sa.Column('tenant_id', sa.String(length=255), nullable=True), + sa.Column('id', sa.String(length=36), nullable=False), + sa.Column('ingress', sa.String(length=36), nullable=True), + sa.Column('egress', sa.String(length=36), nullable=True), + sa.Column('host_id', sa.String(length=255), nullable=False), + sa.Column('mac_address', sa.String(length=32), nullable=False), + sa.Column('network_type', sa.String(length=8), nullable=True), + sa.Column('segment_id', sa.Integer(), nullable=True), + sa.Column('local_endpoint', sa.String(length=64), nullable=False), + sa.PrimaryKeyConstraint('id') + ) + + op.create_index( + op.f('ix_sfc_portpair_details_tenant_id'), + 'sfc_portpair_details', ['tenant_id'], unique=False + ) + op.create_table('sfc_uuid_intid_associations', + sa.Column('id', sa.String(length=36), nullable=False), + sa.Column('uuid', sa.String(length=36), nullable=False), + sa.Column('intid', sa.Integer(), nullable=False), + sa.Column('type_', sa.String(length=32), nullable=False), + sa.PrimaryKeyConstraint('id', 'uuid'), + sa.UniqueConstraint('intid') + ) + + op.create_table('sfc_path_nodes', + sa.Column('tenant_id', sa.String(length=255), nullable=True), + sa.Column('id', sa.String(length=36), nullable=False), + sa.Column('nsp', sa.Integer(), nullable=False), + sa.Column('nsi', sa.Integer(), nullable=False), + sa.Column('node_type', sa.String(length=32), nullable=True), + sa.Column('portchain_id', sa.String(length=255), nullable=True), + sa.Column('status', sa.String(length=32), nullable=True), + sa.Column('next_group_id', sa.Integer(), nullable=True), + sa.Column('next_hop', sa.String(length=512), nullable=True), + sa.ForeignKeyConstraint(['portchain_id'], ['sfc_port_chains.id'], + ondelete='CASCADE'), + sa.PrimaryKeyConstraint('id') + ) + op.create_index( + op.f('ix_sfc_path_nodes_tenant_id'), + 'sfc_path_nodes', ['tenant_id'], unique=False + ) + + op.create_table('sfc_path_port_associations', + sa.Column('pathnode_id', sa.String(length=36), nullable=False), + sa.Column('portpair_id', sa.String(length=36), nullable=False), + sa.Column('weight', sa.Integer(), nullable=False), + sa.ForeignKeyConstraint(['pathnode_id'], ['sfc_path_nodes.id'], + ondelete='CASCADE'), + sa.ForeignKeyConstraint(['portpair_id'], ['sfc_portpair_details.id'], + ondelete='CASCADE'), + sa.PrimaryKeyConstraint('pathnode_id', 'portpair_id') + ) |