@Test
	public void testTableWithIndexRecreateUndo() throws IOException {

		createIndexedTables(false);

		Table[] tables = dbh.getTables();
		String table1Name = tables[1].getName();

		Table t1 = dbh.getTable(table1Name);
		int[] indexedColumns = t1.getIndexedColumns();
		assertEquals(t1.getSchema().getFieldCount(), indexedColumns.length);
		for (int i = 0; i < indexedColumns.length; i++) {
			assertEquals(i, indexedColumns[i]);
		}

		Schema schema = t1.getSchema();

		long txId = dbh.startTransaction();
		try {
			t1.putRecord(schema.createRecord(1));
		}
		finally {
			dbh.endTransaction(txId, true);
		}

		txId = dbh.startTransaction();
		try {
			dbh.deleteTable(table1Name);
			dbh.createTable(table1Name, schema, indexedColumns);
		}
		finally {
			dbh.endTransaction(txId, true);
		}

		dbh.undo();

		Table t1prime = dbh.getTable(table1Name);
		indexedColumns = t1prime.getIndexedColumns();
		assertEquals(t1prime.getSchema().getFieldCount(), indexedColumns.length);
		for (int i = 0; i < indexedColumns.length; i++) {
			assertEquals(i, indexedColumns[i]);
		}

		assertNotNull(t1prime.getRecord(1));

	}
Test the creation of a new database with indexed and non-indexed tables.
Tests include the removal of tables and are performed for both a stored and
non-stored database.
Ghidra/Framework/DB/src/test/java/db/DBTest.java