@@ -177,11 +177,7 @@ protected void doMigrationToTargets(
177
177
}
178
178
179
179
final TableInformation tableInformation = existingDatabase .getTableInformation ( table .getQualifiedTableName () );
180
- if ( tableInformation == null ) {
181
- // big problem...
182
- throw new SchemaManagementException ( "BIG PROBLEM" );
183
- }
184
- if ( !tableInformation .isPhysicalTable () ) {
180
+ if ( tableInformation != null && !tableInformation .isPhysicalTable () ) {
185
181
continue ;
186
182
}
187
183
@@ -267,9 +263,11 @@ private void applyIndexes(Table table, TableInformation tableInformation, Metada
267
263
continue ;
268
264
}
269
265
270
- final IndexInformation existingIndex = findMatchingIndex ( index , tableInformation );
271
- if ( existingIndex != null ) {
272
- continue ;
266
+ if ( tableInformation != null ) {
267
+ final IndexInformation existingIndex = findMatchingIndex ( index , tableInformation );
268
+ if ( existingIndex != null ) {
269
+ continue ;
270
+ }
273
271
}
274
272
275
273
applySqlStrings (
@@ -364,19 +362,22 @@ private void applyForeignKeys(
364
362
continue ;
365
363
}
366
364
367
- final ForeignKeyInformation existingForeignKey = findMatchingForeignKey ( foreignKey , tableInformation );
365
+ if ( tableInformation != null ) {
366
+ final ForeignKeyInformation existingForeignKey = findMatchingForeignKey ( foreignKey , tableInformation );
367
+ if ( existingForeignKey != null ) {
368
+ continue ;
369
+ }
370
+ }
368
371
369
372
// todo : shouldn't we just drop+recreate if FK exists?
370
373
// this follows the existing code from legacy SchemaUpdate which just skipped
371
374
372
- if ( existingForeignKey == null ) {
373
- // in old SchemaUpdate code, this was the trigger to "create"
374
- applySqlStrings (
375
- exporter .getSqlCreateStrings ( foreignKey , metadata ),
376
- targets ,
377
- false
378
- );
379
- }
375
+ // in old SchemaUpdate code, this was the trigger to "create"
376
+ applySqlStrings (
377
+ exporter .getSqlCreateStrings ( foreignKey , metadata ),
378
+ targets ,
379
+ false
380
+ );
380
381
}
381
382
}
382
383
0 commit comments