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 f34c50c411
commit a8deb5f1e0
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 *after* 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;