diff --git a/hibernate-core/src/main/java/org/hibernate/tool/schema/internal/SchemaMigratorImpl.java b/hibernate-core/src/main/java/org/hibernate/tool/schema/internal/SchemaMigratorImpl.java index d4999a77da..3abdb205ea 100644 --- a/hibernate-core/src/main/java/org/hibernate/tool/schema/internal/SchemaMigratorImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/tool/schema/internal/SchemaMigratorImpl.java @@ -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;