private static TypedefDBAdapter upgrade(DBHandle handle, TypedefDBAdapter oldAdapter,
			String tablePrefix, TaskMonitor monitor)
			throws VersionException, IOException, CancelledException {

		DBHandle tmpHandle = new DBHandle();
		long id = tmpHandle.startTransaction();
		TypedefDBAdapter tmpAdapter = null;
		try {
			tmpAdapter = new TypedefDBAdapterV2(tmpHandle, tablePrefix, true);
			RecordIterator it = oldAdapter.getRecords();
			while (it.hasNext()) {
				monitor.checkCancelled();
				DBRecord rec = it.next();
				tmpAdapter.updateRecord(rec, false);
			}
			oldAdapter.deleteTable(handle);
			TypedefDBAdapter newAdapter = new TypedefDBAdapterV2(handle, tablePrefix, true);
			it = tmpAdapter.getRecords();
			while (it.hasNext()) {
				monitor.checkCancelled();
				DBRecord rec = it.next();
				newAdapter.updateRecord(rec, false);
			}
			return newAdapter;
		}
		finally {
			tmpHandle.endTransaction(id, true);
			tmpHandle.close();
		}
	}
Upgrades the Typedef data type table from the oldAdapter's version to the current version.
@param handle handle to the database whose table is to be upgraded to a newer version.
@param oldAdapter the adapter for the existing table to be upgraded.
@param tablePrefix prefix to be used with default table name
@param monitor task monitor
@return the adapter for the new upgraded version of the table.
@throws VersionException if the table's version does not match the expected version
for this adapter.
@throws IOException if the database can't be read or written.
@throws CancelledException if task is cancelled
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/data/TypedefDBAdapter.java