|
|
|
@ -63,28 +63,31 @@ public class IndividuallySchemaMigratorImpl extends AbstractSchemaMigrator {
|
|
|
|
|
namespace, |
|
|
|
|
targets |
|
|
|
|
); |
|
|
|
|
boolean tableValid = true; |
|
|
|
|
for ( Table table : namespace.getTables() ) { |
|
|
|
|
if ( schemaFilter.includeTable( table ) && table.isPhysicalTable() ) { |
|
|
|
|
checkExportIdentifier( table, exportIdentifiers ); |
|
|
|
|
final TableInformation tableInformation = existingDatabase.getTableInformation( table.getQualifiedTableName() ); |
|
|
|
|
if ( tableInformation == null ) { |
|
|
|
|
createTable( table, dialect, metadata, formatter, options, targets ); |
|
|
|
|
tableValid &= createTable( table, dialect, metadata, formatter, options, targets ); |
|
|
|
|
} |
|
|
|
|
else if ( tableInformation != null && tableInformation.isPhysicalTable() ) { |
|
|
|
|
tablesInformation.addTableInformation( tableInformation ); |
|
|
|
|
migrateTable( table, tableInformation, dialect, metadata, formatter, options, targets ); |
|
|
|
|
tableValid &= migrateTable( table, tableInformation, dialect, metadata, formatter, options, targets ); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
for ( Table table : namespace.getTables() ) { |
|
|
|
|
if ( schemaFilter.includeTable( table ) && table.isPhysicalTable() ) { |
|
|
|
|
final TableInformation tableInformation = tablesInformation.getTableInformation( table ); |
|
|
|
|
if ( tableInformation == null || ( tableInformation != null && tableInformation.isPhysicalTable() ) ) { |
|
|
|
|
applyIndexes( table, tableInformation, dialect, metadata, formatter, options, targets ); |
|
|
|
|
applyUniqueKeys( table, tableInformation, dialect, metadata, formatter, options, targets ); |
|
|
|
|
if (tableInformation != null) { |
|
|
|
|
applyPrimaryKey(table, tableInformation, dialect, metadata, formatter, options, targets); |
|
|
|
|
if (tableValid) { |
|
|
|
|
for (Table table : namespace.getTables()) { |
|
|
|
|
if (schemaFilter.includeTable(table) && table.isPhysicalTable()) { |
|
|
|
|
final TableInformation tableInformation = tablesInformation.getTableInformation(table); |
|
|
|
|
if (tableInformation == null || (tableInformation != null && tableInformation.isPhysicalTable())) { |
|
|
|
|
applyIndexes(table, tableInformation, dialect, metadata, formatter, options, targets); |
|
|
|
|
applyUniqueKeys(table, tableInformation, dialect, metadata, formatter, options, targets); |
|
|
|
|
if (tableInformation != null) { |
|
|
|
|
applyPrimaryKey(table, tableInformation, dialect, metadata, formatter, options, targets); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|