Metadata doesn’t contains tables, referenced by foreign keys of the table, being changed.
See traceback
======================================================================
ERROR: tests.unit.db.sqlalchemy.test_utils.TestMigrationUtils.test_change_deleted_column_type_to_boolean_with_fc
----------------------------------------------------------------------
_StringException: Empty attachments:
pythonlogging:'openstack.common'
Traceback (most recent call last):
File "/home/vsergeev/sandbox/oslo-incubator/tests/unit/db/sqlalchemy/test_utils.py", line 384, in test_change_deleted_column_type_to_boolean_with_fc
table_2.create()
File "/home/vsergeev/sandbox/oslo-incubator/.tox/py26/lib/python2.6/site-packages/sqlalchemy/schema.py", line 593, in create
checkfirst=checkfirst)
File "/home/vsergeev/sandbox/oslo-incubator/.tox/py26/lib/python2.6/site-packages/sqlalchemy/engine/base.py", line 2302, in _run_visitor
conn._run_visitor(visitorcallable, element, **kwargs)
File "/home/vsergeev/sandbox/oslo-incubator/.tox/py26/lib/python2.6/site-packages/sqlalchemy/engine/base.py", line 1972, in _run_visitor
**kwargs).traverse_single(element)
File "/home/vsergeev/sandbox/oslo-incubator/.tox/py26/lib/python2.6/site-packages/sqlalchemy/sql/visitors.py", line 106, in traverse_single
return meth(obj, **kw)
File "/home/vsergeev/sandbox/oslo-incubator/.tox/py26/lib/python2.6/site-packages/sqlalchemy/engine/ddl.py", line 86, in visit_table
self.connection.execute(schema.CreateTable(table))
File "/home/vsergeev/sandbox/oslo-incubator/.tox/py26/lib/python2.6/site-packages/sqlalchemy/engine/base.py", line 1449, in execute
params)
File "/home/vsergeev/sandbox/oslo-incubator/.tox/py26/lib/python2.6/site-packages/sqlalchemy/engine/base.py", line 1536, in _execute_ddl
compiled = ddl.compile(dialect=dialect)
File "/home/vsergeev/sandbox/oslo-incubator/.tox/py26/lib/python2.6/site-packages/sqlalchemy/sql/expression.py", line 1778, in compile
return self._compiler(dialect, bind=bind, **kw)
File "/home/vsergeev/sandbox/oslo-incubator/.tox/py26/lib/python2.6/site-packages/sqlalchemy/schema.py", line 2908, in _compiler
return dialect.ddl_compiler(dialect, self, **kw)
File "/home/vsergeev/sandbox/oslo-incubator/.tox/py26/lib/python2.6/site-packages/sqlalchemy/engine/base.py", line 705, in __init__
self.string = self.process(self.statement)
File "/home/vsergeev/sandbox/oslo-incubator/.tox/py26/lib/python2.6/site-packages/sqlalchemy/engine/base.py", line 724, in process
return obj._compiler_dispatch(self, **kwargs)
File "/home/vsergeev/sandbox/oslo-incubator/.tox/py26/lib/python2.6/site-packages/sqlalchemy/sql/visitors.py", line 72, in _compiler_dispatch
return getter(visitor)(self, **kw)
File "/home/vsergeev/sandbox/oslo-incubator/.tox/py26/lib/python2.6/site-packages/sqlalchemy/sql/compiler.py", line 1612, in visit_create_table
const = self.create_table_constraints(table)
File "/home/vsergeev/sandbox/oslo-incubator/.tox/py26/lib/python2.6/site-packages/sqlalchemy/sql/compiler.py", line 1632, in create_table_constraints
for constraint in constraints
File "/home/vsergeev/sandbox/oslo-incubator/.tox/py26/lib/python2.6/site-packages/sqlalchemy/sql/compiler.py", line 1630, in <genexpr>
return ", \n\t".join(p for p in
File "/home/vsergeev/sandbox/oslo-incubator/.tox/py26/lib/python2.6/site-packages/sqlalchemy/sql/compiler.py", line 1638, in <genexpr>
not getattr(constraint, 'use_alter', False)
File "/home/vsergeev/sandbox/oslo-incubator/.tox/py26/lib/python2.6/site-packages/sqlalchemy/engine/base.py", line 724, in process
return obj._compiler_dispatch(self, **kwargs)
File "/home/vsergeev/sandbox/oslo-incubator/.tox/py26/lib/python2.6/site-packages/sqlalchemy/sql/visitors.py", line 72, in _compiler_dispatch
return getter(visitor)(self, **kw)
File "/home/vsergeev/sandbox/oslo-incubator/.tox/py26/lib/python2.6/site-packages/sqlalchemy/dialects/sqlite/base.py", line 454, in visit_foreign_key_constraint
remote_table = list(constraint._elements.values())[0].column.table
File "/home/vsergeev/sandbox/oslo-incubator/.tox/py26/lib/python2.6/site-packages/sqlalchemy/util/langhelpers.py", line 494, in __get__
obj.__dict__[self.__name__] = result = self.fget(obj)
File "/home/vsergeev/sandbox/oslo-incubator/.tox/py26/lib/python2.6/site-packages/sqlalchemy/schema.py", line 1392, in column
tname)
NoReferencedTableError: Foreign key associated with column 'bcd.foreign_id' could not find table '' with which to generate a foreign key to target column 'None'
-------------------- >> begin captured logging << --------------------
tests.unit.db.sqlalchemy.test_migrations: DEBUG: config_path is /home/vsergeev/sandbox/oslo-incubator/tests/unit/db/sqlalchemy/test_migrations.conf
--------------------- >> end captured logging << ---------------------
Fix proposed to branch: master /review. openstack. org/40878
Review: https:/