final UniqueKey uniqueKey = (UniqueKey) uniqueIter.next();
// Skip if index already exists. Most of the time, this
// won't work since most Dialects use Constraints. However,
// keep it for the few that do use Indexes.
if ( tableInfo != null && StringHelper.isNotEmpty( uniqueKey.getName() ) ) {
final IndexMetadata meta = tableInfo.getIndexMetadata( uniqueKey.getName() );
if ( meta != null ) {
continue;
}
}
String constraintString = uniqueKey.sqlCreateString( dialect, mapping, tableCatalog, tableSchema );
if ( constraintString != null && !constraintString.isEmpty() )
if ( constraintMethod.equals( UniqueConstraintSchemaUpdateStrategy.DROP_RECREATE_QUIETLY ) ) {
String constraintDropString = uniqueKey.sqlDropString( dialect, tableCatalog, tableCatalog );
scripts.add( new SchemaUpdateScript( constraintDropString, true) );
}
scripts.add( new SchemaUpdateScript( constraintString, true) );
}
}
Iterator subIter = table.getIndexIterator();
while ( subIter.hasNext() ) {
final Index index = (Index) subIter.next();
// Skip if index already exists
if ( tableInfo != null && StringHelper.isNotEmpty( index.getName() ) ) {
final IndexMetadata meta = tableInfo.getIndexMetadata( index.getName() );
if ( meta != null ) {
continue;
}
}
scripts.add( new SchemaUpdateScript( index.sqlCreateString( dialect, mapping, tableCatalog,