In our constraint free world we've now got alembic 0.8.1 that has this change:
http://alembic.readthedocs.org/en/latest/changelog.html#change-0fbe5d57da5d0fc69adb44615b46a83f
which causes the gnocchi.tests.indexer.sqlalchemy.test_migrations.ModelsMigrationsSync.test_models_sync test to fail. Downgrading to alembic 0.8.0 fixes it.
zzzeek said:
[5:58pm] zzzeek: dims__: a likely reason is alembic 0.8.1
[5:58pm] zzzeek: dims__ / cdent : http://alembic.readthedocs.org/en/latest/changelog.html#change-0fbe5d57da5d0fc69adb44615b46a83f
[5:59pm] • cdent reads
[5:59pm] zzzeek: cdent: yes these FKs have ondelete=RESTRICT in them
[5:59pm] zzzeek: cdent: need that on both sides
Trace from the test:
gnocchi.tests.indexer.sqlalchemy.test_migrations.ModelsMigrationsSync.test_models_sync
--------------------------------------------------------------------------------------
Captured traceback:
~~~~~~~~~~~~~~~~~~~
Traceback (most recent call last):
File "/home/cdent/src/gnocchi/.tox/py27/lib/python2.7/site-packages/oslo_db/sqlalchemy/test_migrations.py", line 603, in test_models_sync
"Models and migration scripts aren't in sync:\n%s" % msg)
File "/home/cdent/src/gnocchi/.tox/py27/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 0x7fb401fe4b90>, None, name=u'fk_archive_policy_rule_archive_policy_name_archive_policy_name', table=Table('archive_policy_rule', MetaData(bind=None), Column('name', VARCHAR(length=255), table=<archive_policy_rule>, primary_key=True, nullable=False), Column('archive_policy_name', VARCHAR(length=255), ForeignKey(u'archive_policy.name'), ForeignKey(u'archive_policy.name'), table=<archive_policy_rule>, nullable=False), Column('metric_pattern', VARCHAR(length=255), table=<archive_policy_rule>, nullable=False), schema=None))),
( 'add_fk',
ForeignKeyConstraint(<sqlalchemy.sql.base.ColumnCollection object at 0x7fb403eebef0>, None, name='fk_archive_policy_rule_archive_policy_name_archive_policy_name', ondelete='RESTRICT', table=Table('archive_policy_rule', MetaData(bind=None), Column('name', String(length=255), table=<archive_policy_rule>, primary_key=True, nullable=False), Column('archive_policy_name', String(length=255), ForeignKey('archive_policy.name'), table=<archive_policy_rule>, nullable=False), Column('metric_pattern', String(length=255), table=<archive_policy_rule>, nullable=False), schema=None))),
( 'remove_fk',
ForeignKeyConstraint(<sqlalchemy.sql.base.ColumnCollection object at 0x7fb401f8a560>, None, name=u'fk_metric_archive_policy_name_archive_policy_name', table=Table('metric', MetaData(bind=None), Column('id', BINARY(length=16), table=<metric>, primary_key=True, nullable=False), Column('archive_policy_name', VARCHAR(length=255), ForeignKey(u'archive_policy.name'), ForeignKey(u'archive_policy.name'), table=<metric>, nullable=False), Column('created_by_user_id', BINARY(length=16), table=<metric>), Column('created_by_project_id', BINARY(length=16), table=<metric>), Column('resource_id', BINARY(length=16), ForeignKey(u'resource.id'), ForeignKey(u'resource.id'), table=<metric>), Column('name', VARCHAR(length=255), table=<metric>), schema=None))),
( 'add_fk',
ForeignKeyConstraint(<sqlalchemy.sql.base.ColumnCollection object at 0x7fb403f8df80>, None, name='fk_metric_archive_policy_name_archive_policy_name', ondelete='RESTRICT', table=Table('metric', MetaData(bind=None), Column('id', UUIDType(length=16), table=<metric>, primary_key=True, nullable=False), Column('archive_policy_name', String(length=255), ForeignKey('archive_policy.name'), table=<metric>, nullable=False), Column('created_by_user_id', UUIDType(length=16), table=<metric>), Column('created_by_project_id', UUIDType(length=16), table=<metric>), Column('resource_id', UUIDType(length=16), ForeignKey('resource.id'), table=<metric>), Column('name', String(length=255), table=<metric>), schema=None)))]
Related fix proposed to branch: master /review. openstack. org/216722
Review: https:/