Browse Source

REPORT-78654 迁移报错优化

feature/x
lidongy 2 years ago
parent
commit
e3c82e02ca
  1. 5
      fine-hibernate/src/main/java/com/fr/third/org/hibernate/tool/schema/internal/AbstractSchemaMigrator.java

5
fine-hibernate/src/main/java/com/fr/third/org/hibernate/tool/schema/internal/AbstractSchemaMigrator.java

@ -613,13 +613,16 @@ public abstract class AbstractSchemaMigrator implements SchemaMigrator {
ExecutionOptions options, ExecutionOptions options,
GenerationTarget... targets) { GenerationTarget... targets) {
if ( !StringHelper.isEmpty( sqlString ) ) { if ( !StringHelper.isEmpty( sqlString ) ) {
String formattedSql = null;
for ( GenerationTarget target : targets ) { for ( GenerationTarget target : targets ) {
try { try {
target.accept( formatter.format( sqlString ) ); formattedSql = formatter.format( sqlString );
target.accept( formattedSql );
} }
catch (CommandAcceptanceException e) { catch (CommandAcceptanceException e) {
if ( !quiet ) { if ( !quiet ) {
options.getExceptionHandler().handleException( e ); options.getExceptionHandler().handleException( e );
log.warnf( formattedSql );
} }
return false; return false;
} }

Loading…
Cancel
Save