yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #37056
[Bug 1486936] [NEW] Migration scripts and db models are not in sync
Public bug reported:
Alembic used to not compare foreign keys correctly that caused migration
scripts and db models are out of sync. With new alembic version that
fixed the bug [1] we are gonna fail in Neutron:
Captured traceback:
~~~~~~~~~~~~~~~~~~~
Traceback (most recent call last):
File "neutron/tests/functional/db/test_migrations.py", line 166, in test_models_sync
self.fail("Models and migration scripts aren't in sync:\n%s" % msg)
File "/opt/stack/neutron/.tox/functional/lib/python2.7/site-packages/unittest2/case.py", line 690, in fail
raise self.failureException(msg)
AssertionError: Models and migration scripts aren't in sync:
[ ( 'remove_fk',
ForeignKeyConstraint(<sqlalchemy.sql.base.ColumnCollection object at 0x7f42a80e9a28>, None, name=u'csnat_l3_agent_bindings_ibfk_3', ondelete=u'CASCADE', table=Table('csnat_l3_agent_bindings', MetaData(bind=None), Column('router_id', VARCHAR(length=36), ForeignKey(u'routers.id'), ForeignKey(u'routers.id'), table=<csnat_l3_agent_bindings>, primary_key=True, nullable=False), Column('l3_agent_id', VARCHAR(length=36), ForeignKey(u'agents.id'), ForeignKey(u'agents.id'), table=<csnat_l3_agent_bindings>, primary_key=True, nullable=False), Column('host_id', VARCHAR(length=255), table=<csnat_l3_agent_bindings>), Column('csnat_gw_port_id', VARCHAR(length=36), ForeignKey(u'ports.id'), ForeignKey(u'ports.id'), table=<csnat_l3_agent_bindings>), schema=None))),
( 'add_fk',
ForeignKeyConstraint(<sqlalchemy.sql.base.ColumnCollection object at 0x7f42a9235518>, None, table=Table('csnat_l3_agent_bindings', MetaData(bind=None), Column('router_id', String(length=36), ForeignKey('routers.id'), table=<csnat_l3_agent_bindings>, primary_key=True, nullable=False), Column('l3_agent_id', String(length=36), ForeignKey('agents.id'), table=<csnat_l3_agent_bindings>, primary_key=True, nullable=False), Column('host_id', String(length=255), table=<csnat_l3_agent_bindings>), Column('csnat_gw_port_id', String(length=36), ForeignKey('ports.id'), table=<csnat_l3_agent_bindings>), schema=None))),
( 'remove_fk',
ForeignKeyConstraint(<sqlalchemy.sql.base.ColumnCollection object at 0x7f42a80fe0e0>, None, name=u'flavorserviceprofilebindings_ibfk_1', table=Table('flavorserviceprofilebindings', MetaData(bind=None), Column('service_profile_id', VARCHAR(length=36), ForeignKey(u'serviceprofiles.id'), ForeignKey(u'serviceprofiles.id'), table=<flavorserviceprofilebindings>, primary_key=True, nullable=False), Column('flavor_id', VARCHAR(length=36), ForeignKey(u'flavors.id'), ForeignKey(u'flavors.id'), table=<flavorserviceprofilebindings>, primary_key=True, nullable=False), schema=None))),
( 'remove_fk',
ForeignKeyConstraint(<sqlalchemy.sql.base.ColumnCollection object at 0x7f42a80fe290>, None, name=u'flavorserviceprofilebindings_ibfk_2', table=Table('flavorserviceprofilebindings', MetaData(bind=None), Column('service_profile_id', VARCHAR(length=36), ForeignKey(u'serviceprofiles.id'), ForeignKey(u'serviceprofiles.id'), table=<flavorserviceprofilebindings>, primary_key=True, nullable=False), Column('flavor_id', VARCHAR(length=36), ForeignKey(u'flavors.id'), ForeignKey(u'flavors.id'), table=<flavorserviceprofilebindings>, primary_key=True, nullable=False), schema=None))),
( 'add_fk',
ForeignKeyConstraint(<sqlalchemy.sql.base.ColumnCollection object at 0x7f42a9e6bfc8>, None, ondelete='CASCADE', table=Table('flavorserviceprofilebindings', MetaData(bind=None), Column('flavor_id', String(length=36), ForeignKey('flavors.id'), table=<flavorserviceprofilebindings>, primary_key=True, nullable=False), Column('service_profile_id', String(length=36), ForeignKey('serviceprofiles.id'), table=<flavorserviceprofilebindings>, primary_key=True, nullable=False), schema=None))),
( 'add_fk',
ForeignKeyConstraint(<sqlalchemy.sql.base.ColumnCollection object at 0x7f42a9e6be60>, None, ondelete='CASCADE', table=Table('flavorserviceprofilebindings', MetaData(bind=None), Column('flavor_id', String(length=36), ForeignKey('flavors.id'), table=<flavorserviceprofilebindings>, primary_key=True, nullable=False), Column('service_profile_id', String(length=36), ForeignKey('serviceprofiles.id'), table=<flavorserviceprofilebindings>, primary_key=True, nullable=False), schema=None))),
( 'remove_fk',
ForeignKeyConstraint(<sqlalchemy.sql.base.ColumnCollection object at 0x7f42a80673f8>, None, name=u'qos_bandwidth_limit_rules_ibfk_1', ondelete=u'CASCADE', table=Table('qos_bandwidth_limit_rules', MetaData(bind=None), Column('id', VARCHAR(length=36), table=<qos_bandwidth_limit_rules>, primary_key=True, nullable=False), Column('qos_policy_id', VARCHAR(length=36), ForeignKey(u'qos_policies.id'), ForeignKey(u'qos_policies.id'), table=<qos_bandwidth_limit_rules>, nullable=False), Column('max_kbps', INTEGER(display_width=11), table=<qos_bandwidth_limit_rules>), Column('max_burst_kbps', INTEGER(display_width=11), table=<qos_bandwidth_limit_rules>), schema=None))),
( 'add_fk',
ForeignKeyConstraint(<sqlalchemy.sql.base.ColumnCollection object at 0x7f42aa5cb488>, None, table=Table('qos_bandwidth_limit_rules', MetaData(bind=None), Column('id', String(length=36), table=<qos_bandwidth_limit_rules>, primary_key=True, nullable=False, default=ColumnDefault(<function <lambda> at 0x7f42aa72b1b8>)), Column('qos_policy_id', String(length=36), ForeignKey('qos_policies.id'), table=<qos_bandwidth_limit_rules>, nullable=False), Column('max_kbps', Integer(), table=<qos_bandwidth_limit_rules>), Column('max_burst_kbps', Integer(), table=<qos_bandwidth_limit_rules>), schema=None))),
( 'remove_fk',
ForeignKeyConstraint(<sqlalchemy.sql.base.ColumnCollection object at 0x7f42a8095638>, None, name=u'subnetpoolprefixes_ibfk_1', ondelete=u'CASCADE', table=Table('subnetpoolprefixes', MetaData(bind=None), Column('cidr', VARCHAR(length=64), table=<subnetpoolprefixes>, primary_key=True, nullable=False), Column('subnetpool_id', VARCHAR(length=36), ForeignKey(u'subnetpools.id'), ForeignKey(u'subnetpools.id'), table=<subnetpoolprefixes>, primary_key=True, nullable=False), schema=None))),
( 'add_fk',
ForeignKeyConstraint(<sqlalchemy.sql.base.ColumnCollection object at 0x7f42aa608ea8>, None, table=Table('subnetpoolprefixes', MetaData(bind=None), Column('cidr', String(length=64), table=<subnetpoolprefixes>, primary_key=True, nullable=False), Column('subnetpool_id', String(length=36), ForeignKey('subnetpools.id'), table=<subnetpoolprefixes>, primary_key=True, nullable=False), schema=None)))]
[1] https://bitbucket.org/zzzeek/alembic/issues/317
** Affects: neutron
Importance: Undecided
Status: New
** Tags: db
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1486936
Title:
Migration scripts and db models are not in sync
Status in neutron:
New
Bug description:
Alembic used to not compare foreign keys correctly that caused
migration scripts and db models are out of sync. With new alembic
version that fixed the bug [1] we are gonna fail in Neutron:
Captured traceback:
~~~~~~~~~~~~~~~~~~~
Traceback (most recent call last):
File "neutron/tests/functional/db/test_migrations.py", line 166, in test_models_sync
self.fail("Models and migration scripts aren't in sync:\n%s" % msg)
File "/opt/stack/neutron/.tox/functional/lib/python2.7/site-packages/unittest2/case.py", line 690, in fail
raise self.failureException(msg)
AssertionError: Models and migration scripts aren't in sync:
[ ( 'remove_fk',
ForeignKeyConstraint(<sqlalchemy.sql.base.ColumnCollection object at 0x7f42a80e9a28>, None, name=u'csnat_l3_agent_bindings_ibfk_3', ondelete=u'CASCADE', table=Table('csnat_l3_agent_bindings', MetaData(bind=None), Column('router_id', VARCHAR(length=36), ForeignKey(u'routers.id'), ForeignKey(u'routers.id'), table=<csnat_l3_agent_bindings>, primary_key=True, nullable=False), Column('l3_agent_id', VARCHAR(length=36), ForeignKey(u'agents.id'), ForeignKey(u'agents.id'), table=<csnat_l3_agent_bindings>, primary_key=True, nullable=False), Column('host_id', VARCHAR(length=255), table=<csnat_l3_agent_bindings>), Column('csnat_gw_port_id', VARCHAR(length=36), ForeignKey(u'ports.id'), ForeignKey(u'ports.id'), table=<csnat_l3_agent_bindings>), schema=None))),
( 'add_fk',
ForeignKeyConstraint(<sqlalchemy.sql.base.ColumnCollection object at 0x7f42a9235518>, None, table=Table('csnat_l3_agent_bindings', MetaData(bind=None), Column('router_id', String(length=36), ForeignKey('routers.id'), table=<csnat_l3_agent_bindings>, primary_key=True, nullable=False), Column('l3_agent_id', String(length=36), ForeignKey('agents.id'), table=<csnat_l3_agent_bindings>, primary_key=True, nullable=False), Column('host_id', String(length=255), table=<csnat_l3_agent_bindings>), Column('csnat_gw_port_id', String(length=36), ForeignKey('ports.id'), table=<csnat_l3_agent_bindings>), schema=None))),
( 'remove_fk',
ForeignKeyConstraint(<sqlalchemy.sql.base.ColumnCollection object at 0x7f42a80fe0e0>, None, name=u'flavorserviceprofilebindings_ibfk_1', table=Table('flavorserviceprofilebindings', MetaData(bind=None), Column('service_profile_id', VARCHAR(length=36), ForeignKey(u'serviceprofiles.id'), ForeignKey(u'serviceprofiles.id'), table=<flavorserviceprofilebindings>, primary_key=True, nullable=False), Column('flavor_id', VARCHAR(length=36), ForeignKey(u'flavors.id'), ForeignKey(u'flavors.id'), table=<flavorserviceprofilebindings>, primary_key=True, nullable=False), schema=None))),
( 'remove_fk',
ForeignKeyConstraint(<sqlalchemy.sql.base.ColumnCollection object at 0x7f42a80fe290>, None, name=u'flavorserviceprofilebindings_ibfk_2', table=Table('flavorserviceprofilebindings', MetaData(bind=None), Column('service_profile_id', VARCHAR(length=36), ForeignKey(u'serviceprofiles.id'), ForeignKey(u'serviceprofiles.id'), table=<flavorserviceprofilebindings>, primary_key=True, nullable=False), Column('flavor_id', VARCHAR(length=36), ForeignKey(u'flavors.id'), ForeignKey(u'flavors.id'), table=<flavorserviceprofilebindings>, primary_key=True, nullable=False), schema=None))),
( 'add_fk',
ForeignKeyConstraint(<sqlalchemy.sql.base.ColumnCollection object at 0x7f42a9e6bfc8>, None, ondelete='CASCADE', table=Table('flavorserviceprofilebindings', MetaData(bind=None), Column('flavor_id', String(length=36), ForeignKey('flavors.id'), table=<flavorserviceprofilebindings>, primary_key=True, nullable=False), Column('service_profile_id', String(length=36), ForeignKey('serviceprofiles.id'), table=<flavorserviceprofilebindings>, primary_key=True, nullable=False), schema=None))),
( 'add_fk',
ForeignKeyConstraint(<sqlalchemy.sql.base.ColumnCollection object at 0x7f42a9e6be60>, None, ondelete='CASCADE', table=Table('flavorserviceprofilebindings', MetaData(bind=None), Column('flavor_id', String(length=36), ForeignKey('flavors.id'), table=<flavorserviceprofilebindings>, primary_key=True, nullable=False), Column('service_profile_id', String(length=36), ForeignKey('serviceprofiles.id'), table=<flavorserviceprofilebindings>, primary_key=True, nullable=False), schema=None))),
( 'remove_fk',
ForeignKeyConstraint(<sqlalchemy.sql.base.ColumnCollection object at 0x7f42a80673f8>, None, name=u'qos_bandwidth_limit_rules_ibfk_1', ondelete=u'CASCADE', table=Table('qos_bandwidth_limit_rules', MetaData(bind=None), Column('id', VARCHAR(length=36), table=<qos_bandwidth_limit_rules>, primary_key=True, nullable=False), Column('qos_policy_id', VARCHAR(length=36), ForeignKey(u'qos_policies.id'), ForeignKey(u'qos_policies.id'), table=<qos_bandwidth_limit_rules>, nullable=False), Column('max_kbps', INTEGER(display_width=11), table=<qos_bandwidth_limit_rules>), Column('max_burst_kbps', INTEGER(display_width=11), table=<qos_bandwidth_limit_rules>), schema=None))),
( 'add_fk',
ForeignKeyConstraint(<sqlalchemy.sql.base.ColumnCollection object at 0x7f42aa5cb488>, None, table=Table('qos_bandwidth_limit_rules', MetaData(bind=None), Column('id', String(length=36), table=<qos_bandwidth_limit_rules>, primary_key=True, nullable=False, default=ColumnDefault(<function <lambda> at 0x7f42aa72b1b8>)), Column('qos_policy_id', String(length=36), ForeignKey('qos_policies.id'), table=<qos_bandwidth_limit_rules>, nullable=False), Column('max_kbps', Integer(), table=<qos_bandwidth_limit_rules>), Column('max_burst_kbps', Integer(), table=<qos_bandwidth_limit_rules>), schema=None))),
( 'remove_fk',
ForeignKeyConstraint(<sqlalchemy.sql.base.ColumnCollection object at 0x7f42a8095638>, None, name=u'subnetpoolprefixes_ibfk_1', ondelete=u'CASCADE', table=Table('subnetpoolprefixes', MetaData(bind=None), Column('cidr', VARCHAR(length=64), table=<subnetpoolprefixes>, primary_key=True, nullable=False), Column('subnetpool_id', VARCHAR(length=36), ForeignKey(u'subnetpools.id'), ForeignKey(u'subnetpools.id'), table=<subnetpoolprefixes>, primary_key=True, nullable=False), schema=None))),
( 'add_fk',
ForeignKeyConstraint(<sqlalchemy.sql.base.ColumnCollection object at 0x7f42aa608ea8>, None, table=Table('subnetpoolprefixes', MetaData(bind=None), Column('cidr', String(length=64), table=<subnetpoolprefixes>, primary_key=True, nullable=False), Column('subnetpool_id', String(length=36), ForeignKey('subnetpools.id'), table=<subnetpoolprefixes>, primary_key=True, nullable=False), schema=None)))]
[1] https://bitbucket.org/zzzeek/alembic/issues/317
To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1486936/+subscriptions
Follow ups