public void renameUniqueIndexes() throws IOException {
String testDir = BuildDirectoryUtils.getBuildDirectoryPath();
// start with a table
VoltProjectBuilder builder = new VoltProjectBuilder();
builder.addLiteralSchema("\nCREATE TABLE A (C1 BIGINT NOT NULL, C2 BIGINT NOT NULL, PRIMARY KEY(C1));");
builder.addLiteralSchema("\nCREATE UNIQUE INDEX IDX ON A(C1,C2);");
builder.addLiteralSchema("\nCREATE INDEX IDX2 ON A(C2);");
builder.addPartitionInfo("A", "C1");
builder.addProcedures(org.voltdb.catalog.ProcedureA.class);
builder.compile(testDir + File.separator + "renameUniqueIndexes1.jar");
Catalog catOriginal = catalogForJar(testDir + File.separator + "renameUniqueIndexes1.jar");
// rename an index
VoltProjectBuilder builder2 = new VoltProjectBuilder();
builder2.addLiteralSchema("\nCREATE TABLE A (C1 BIGINT NOT NULL, C2 BIGINT NOT NULL, PRIMARY KEY(C1));");
builder2.addLiteralSchema("\nCREATE UNIQUE INDEX RYANLIKETHEYANKEES ON A(C1,C2);");
builder2.addLiteralSchema("\nCREATE INDEX GAGNAMSTYLE ON A(C2);");
builder2.addPartitionInfo("A", "C1");
builder2.addProcedures(org.voltdb.catalog.ProcedureA.class);
builder2.compile(testDir + File.separator + "renameUniqueIndexes2.jar");
Catalog catUpdated = catalogForJar(testDir + File.separator + "renameUniqueIndexes2.jar");
verifyDiff(catOriginal, catUpdated);
}