if (index != null) {
tn.addIndex(session, index);
}
HsqlArrayList newList = new HsqlArrayList();
if (newPK) {
constraint.core.mainIndex = tn.indexList[0];
constraint.core.mainTable = tn;
constraint.core.mainTableName = tn.tableName;
newList.add(constraint);
}
for (int i = 0; i < constraintList.length; i++) {
Constraint c = constraintList[i];
if (dropConstraints.contains(c.getName())) {
continue;
}
c = c.duplicate();
c.updateTable(session, this, tn, colIndex, adjust);
newList.add(c);
}
if (!newPK && constraint != null) {
constraint.updateTable(session, this, tn, -1, 0);
newList.add(constraint);
}
tn.constraintList = new Constraint[newList.size()];
newList.toArray(tn.constraintList);
tn.updateConstraintLists();
tn.setBestRowIdentifiers();
tn.triggerList = triggerList;
tn.triggerLists = triggerLists;