HHH-10526 - Fix SchemaMigrator does not apply SchemaFilter on foreign keys

This commit is contained in:
Andrea Boriero 2016-04-14 16:45:50 +01:00
parent 7ac83badf3
commit 0b9e81d35c
1 changed files with 6 additions and 0 deletions

View File

@ -301,7 +301,13 @@ public class SchemaMigratorImpl implements SchemaMigrator {
//NOTE : Foreign keys must be created *afterQuery* all tables of all namespaces for cross namespace fks. see HHH-10420
for ( Namespace namespace : database.getNamespaces() ) {
if ( !schemaFilter.includeNamespace( namespace ) ) {
continue;
}
for ( Table table : namespace.getTables() ) {
if ( !schemaFilter.includeTable( table ) ) {
continue;
}
final TableInformation tableInformation = existingDatabase.getTableInformation( table.getQualifiedTableName() );
if ( tableInformation != null && !tableInformation.isPhysicalTable() ) {
continue;