~niedbalski/ubuntu/vivid/neutron/fixes-1447803

« back to all changes in this revision

Viewing changes to neutron/db/migration/alembic_migrations/versions/e766b19a3bb_nuage_initial.py

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2014-10-03 18:45:23 UTC
  • mfrom: (1.1.15)
  • Revision ID: package-import@ubuntu.com-20141003184523-4mt6dy1q3j8n30c9
Tags: 1:2014.2~rc1-0ubuntu1
* New upstream release candidate:
  - d/p/*: Refreshed.
  - d/control: Add python-requests-mock to BD's.
  - d/control: Align versioned requirements with upstream.
* Transition linuxbridge and openvswitch plugin users to modular
  layer 2 plugin (LP: #1323729):
  - d/control: Mark removed plugin packages as transitional, depend
    on neutron-plugin-ml2, mark oldlibs/extra.
  - d/neutron-plugin-{linuxbridge,openvswitch}.install: Drop.
  - d/control: Depend on neutron-plugin-ml2 for linuxbridge
    agent package.
  - d/neutron-plugin-linuxbridge-agent.upstart: Use ml2 plugin
    configuration files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
revision = 'e766b19a3bb'
26
26
down_revision = '1b2580001654'
27
27
 
28
 
migration_for_plugins = [
29
 
    'neutron.plugins.nuage.plugin.NuagePlugin'
30
 
]
31
 
 
32
28
from alembic import op
33
29
import sqlalchemy as sa
34
30
 
35
31
from neutron.db import migration
36
 
from neutron.db.migration.alembic_migrations import common_ext_ops
37
 
 
38
 
 
39
 
def upgrade(active_plugins=None, options=None):
40
 
    if not migration.should_run(active_plugins, migration_for_plugins):
 
32
 
 
33
 
 
34
def upgrade():
 
35
 
 
36
    if not migration.schema_has_table('routers'):
 
37
        # In the database we are migrating from, the configured plugin
 
38
        # did not create the routers table.
41
39
        return
42
40
 
43
 
    common_ext_ops.upgrade_l3()
44
 
 
45
 
    op.create_table(
46
 
        'quotas',
47
 
        sa.Column('id', sa.String(length=36), nullable=False),
48
 
        sa.Column('tenant_id', sa.String(length=255), nullable=True),
49
 
        sa.Column('resource', sa.String(length=255), nullable=True),
50
 
        sa.Column('limit', sa.Integer(), nullable=True),
51
 
        sa.PrimaryKeyConstraint('id'),
52
 
    )
53
41
    op.create_table(
54
42
        'net_partitions',
55
43
        sa.Column('id', sa.String(length=36), nullable=False),
77
65
                  nullable=True),
78
66
        sa.Column('nuage_user_id', sa.String(length=36), nullable=True),
79
67
        sa.Column('nuage_group_id', sa.String(length=36), nullable=True),
80
 
        sa.ForeignKeyConstraint(['net_partition_id'], ['net_partitions.id'],
81
 
                                ondelete='CASCADE'),
82
68
        sa.ForeignKeyConstraint(['subnet_id'], ['subnets.id'],
83
69
                                ondelete='CASCADE'),
 
70
        sa.ForeignKeyConstraint(['net_partition_id'], ['net_partitions.id'],
 
71
                                ondelete='CASCADE'),
84
72
        sa.PrimaryKeyConstraint('subnet_id'),
85
73
    )
86
74
    op.create_table(
92
80
                                ondelete='CASCADE'),
93
81
        sa.ForeignKeyConstraint(['router_id'], ['routers.id'],
94
82
                                ondelete='CASCADE'),
95
 
        sa.PrimaryKeyConstraint('router_id'),
 
83
        sa.PrimaryKeyConstraint('net_partition_id', 'router_id'),
96
84
    )
97
85
    op.create_table(
98
86
        'router_zone_mapping',
106
94
    )
107
95
 
108
96
 
109
 
def downgrade(active_plugins=None, options=None):
110
 
    pass
 
 
b'\\ No newline at end of file'
 
97
def downgrade():
 
98
    pass