if ( fk.isPhysicalConstraint() ) {
boolean create = tableInfo == null || ( tableInfo.getForeignKeyMetadata( fk ) == null && (
// Icky workaround for MySQL bug:
!( dialect instanceof MySQLDialect ) || tableInfo.getIndexMetadata( fk.getName() ) == null ) );
if ( create ) {
scripts.add( new SchemaUpdateScript( fk.sqlCreateString( dialect, mapping,
tableCatalog, tableSchema ), false ) );
}
}
}
}