while (subChangeIterator.hasNext()) {
StructuralChange<? extends DBObject> change = subChangeIterator.next();
if (change instanceof ConstraintDeletion) {
// check all dropped constraints of the table if there is one created with the same name
ConstraintDeletion<?> deletion = (ConstraintDeletion<?>) change;
DBConstraint constraint1 = deletion.getAffectedObject();
ConstraintCreation<?> creation = tableChange.getSubChange(ConstraintCreation.class, constraint1.getName());
if (creation != null && deletion.getAffectedObject().getClass().equals(creation.getAffectedObject().getClass())) {
// So there are two constraint of same name and type
// and the TableComparator already has sieved out cases with pure column reordering
String[] colNames1 = constraint1.getColumnNames();
DBConstraint constraint2 = creation.getAffectedObject();
String[] colNames2 = constraint2.getColumnNames();
if (ArrayUtil.containsAll(colNames2, colNames1)) {
// columns were removed from the constraint
String[] removedColumns = diff(colNames1, colNames2);
changesToAdd.add(new ConstraintColumnsRemoval(constraint1, removedColumns));
creationsToRemove.add(creation);