Skip to content

Instantly share code, notes, and snippets.

@trozet
Created November 6, 2015 19:27
Show Gist options
  • Save trozet/1dd984b49b9565b9b936 to your computer and use it in GitHub Desktop.
Save trozet/1dd984b49b9565b9b936 to your computer and use it in GitHub Desktop.
Copyright 2015 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.
#
"""adds SFC and Classifier
Revision ID: 471b465518c2
Revises: 5958429bcb3c
Create Date: 2015-11-06 19:09:03.467483
"""
# revision identifiers, used by Alembic.
revision = '471b465518c2'
down_revision = '5958429bcb3c'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
from tacker.db import migration
def upgrade(active_plugins=None, options=None):
op.create_table('sfcs',
sa.Column('tenant_id', mysql.VARCHAR(length=255), nullable=True),
sa.Column('id', mysql.VARCHAR(length=255), nullable=False),
sa.Column('name', mysql.VARCHAR(length=255), nullable=True),
sa.Column('description', mysql.VARCHAR(length=255), nullable=True),
sa.Column('instance_id', mysql.VARCHAR(length=255), nullable=True),
sa.Column('status', mysql.VARCHAR(length=255), nullable=False),
sa.Column('infra_driver', mysql.VARCHAR(length=255), nullable=True),
sa.Column('symmetrical', mysql.TINYINT(display_width=1), autoincrement=False, nullable=True),
sa.Column('chain', sa.BLOB(), nullable=True),
sa.PrimaryKeyConstraint('id'),
mysql_default_charset=u'utf8',
mysql_engine=u'InnoDB'
)
op.create_table('sfcattributes',
sa.Column('id', mysql.VARCHAR(length=36), nullable=False),
sa.Column('sfc_id', mysql.VARCHAR(length=255), nullable=False),
sa.Column('key', mysql.VARCHAR(length=255), nullable=False),
sa.Column('value', mysql.VARCHAR(length=4096), nullable=True),
sa.ForeignKeyConstraint(['sfc_id'], [u'sfcs.id'], name=u'sfcattributes_ibfk_1'),
sa.PrimaryKeyConstraint('id'),
mysql_default_charset=u'utf8',
mysql_engine=u'InnoDB'
)
op.create_table('sfcclassifiers',
sa.Column('tenant_id', mysql.VARCHAR(length=255), nullable=True),
sa.Column('id', mysql.VARCHAR(length=255), nullable=False),
sa.Column('name', mysql.VARCHAR(length=255), nullable=True),
sa.Column('description', mysql.VARCHAR(length=255), nullable=True),
sa.Column('instance_id', mysql.VARCHAR(length=255), nullable=True),
sa.Column('status', mysql.VARCHAR(length=255), nullable=False),
sa.Column('infra_driver', mysql.VARCHAR(length=255), nullable=True),
sa.Column('chain_id', mysql.VARCHAR(length=255), nullable=True),
sa.PrimaryKeyConstraint('id'),
mysql_default_charset=u'utf8',
mysql_engine=u'InnoDB'
)
op.create_table('aclmatchcriterias',
sa.Column('id', mysql.VARCHAR(length=36), nullable=False),
sa.Column('sfcc_id', mysql.VARCHAR(length=36), nullable=True),
sa.Column('source_mac', mysql.VARCHAR(length=36), nullable=True),
sa.Column('dest_mac', mysql.VARCHAR(length=36), nullable=True),
sa.Column('ethertype', mysql.VARCHAR(length=36), nullable=True),
sa.Column('source_ip_prefix', mysql.VARCHAR(length=36), nullable=True),
sa.Column('dest_ip_prefix', mysql.VARCHAR(length=36), nullable=True),
sa.Column('source_port', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True),
sa.Column('dest_port', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True),
sa.Column('protocol', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True),
sa.ForeignKeyConstraint(['sfcc_id'], [u'sfcclassifiers.id'], name=u'aclmatchcriterias_ibfk_1'),
sa.PrimaryKeyConstraint('id'),
mysql_default_charset=u'utf8',
mysql_engine=u'InnoDB'
)
op.create_table('sfccattributes',
sa.Column('id', mysql.VARCHAR(length=36), nullable=False),
sa.Column('sfcc_id', mysql.VARCHAR(length=255), nullable=False),
sa.Column('key', mysql.VARCHAR(length=255), nullable=False),
sa.Column('value', mysql.VARCHAR(length=4096), nullable=True),
sa.ForeignKeyConstraint(['sfcc_id'], [u'sfcclassifiers.id'], name=u'sfccattributes_ibfk_1'),
sa.PrimaryKeyConstraint('id'),
mysql_default_charset=u'utf8',
mysql_engine=u'InnoDB'
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment