Before creating a Foreignkey the code checks if the table is a physical one.
for ( Table table : namespace.getTables() ) {
if ( !table.isPhysicalTable() ) {
continue;
}
final TableInformation tableInformation = existingDatabase.getTableInformation( table.getQualifiedTableName() );
if ( tableInformation != null && !tableInformation.isPhysicalTable() ) {
continue;
}
...
...
applyForeignKeys( table, tableInformation, metadata, targets );
}
This table information is obtained through the DatabaseMetaData#getTables(), checking if the ResultSet TABLE_TYPE is equal to "TABLE".
MariaDB driver implementation of the DatabaseMetaData instead of returning "TABLE" returns "BASE TABLE".
|