switch(cdn.getVerifyType()) {
case PRIMARY_KEY:
if(origTable.getPrimaryKey() == null) {
skipOrThrow(context, cdn.getExistenceCheck(),
null,
new NoSuchConstraintException(origTable.getName(), Index.PRIMARY));
name = null;
} else {
name = origTable.getPrimaryKey().getIndex().getIndexName().getName();
}
break;
case DROP:
boolean found = false;
String indexName = indexNameForConstrainName(origTable, name);
if (indexName != null) {
found = true;
name = indexName;
} else if (origTable.getReferencingForeignKey(name) != null) {
fkDefNodes.add(newFKDropNode(node, name, Boolean.FALSE));
found = true;
} else if (origTable.getParentJoin() != null && origTable.getParentJoin().getName().equals(name)) {
fkDefNodes.add(newFKDropNode(node, name, Boolean.TRUE));
found = true;
name = null;
}
if(!found) {
skipOrThrow(context,
cdn.getExistenceCheck(),
null,
new NoSuchConstraintException(origTable.getName(), name));
name = null;
}
break;
case UNIQUE:
Index index = origTable.getIndex(name);