]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Correct cisco_ml2_apic_contracts.router_id length
authorVladislav Belogrudov <vladislav.belogrudov@oracle.com>
Wed, 17 Jun 2015 11:20:16 +0000 (14:20 +0300)
committerHenry Gessau <gessau@cisco.com>
Thu, 1 Oct 2015 01:14:26 +0000 (21:14 -0400)
Some database engines require exact match of sizes of foreign keys
and referenced fields. Foreign key router_id of table
cisco_ml2_apic_contracts is varchar(64) but it references field
id varchar(36) of table routers. This gives error while running
migration scripts in such databases.

This change only applies to new OpenStack installations

Change-Id: I94a21ffbb82446499b1a55bd8b666d7395e4908a
Related-Bug: #1463806
Closes-Bug: #1465678

neutron/db/migration/alembic_migrations/cisco_init_ops.py

index 9df1bccc182b6d3414bb242373e5aeae77100093..635562e7a1066d410eb8f0f012ce1a45af7ed230 100644 (file)
@@ -190,7 +190,7 @@ def upgrade():
     op.create_table(
         'cisco_ml2_apic_contracts',
         sa.Column('tenant_id', sa.String(length=255)),
-        sa.Column('router_id', sa.String(length=64), nullable=False),
+        sa.Column('router_id', sa.String(length=36), nullable=False),
         sa.ForeignKeyConstraint(['router_id'], ['routers.id']),
         sa.PrimaryKeyConstraint('router_id'))