private boolean removeModuleRecord(String name) throws IOException, NotEmptyException {

		DBRecord rec = moduleAdapter.getModuleRecord(name);
		if (rec == null) {
			return false;
		}
		boolean deleteChild = false;
		long childID = rec.getKey();
		DBRecord pcRec = parentChildAdapter.getParentChildRecord(key, childID);
		if (pcRec == null) {
			return false;
		}

		Field[] keys =
			parentChildAdapter.getParentChildKeys(childID, ParentChildDBAdapter.CHILD_ID_COL);
		if (keys.length == 1) {
			ProgramModule module = moduleMgr.getModuleDB(childID);
			if (module.getNumChildren() > 0) {
				throw new NotEmptyException(getName() + " is not empty");
			}
			deleteChild = true;
		}

		return removeChild(childID, pcRec, false, deleteChild);
	}
Constructor
@param moduleMgr module manager
@param cache ModuleDB cache
@param record database record for this module
@throws IOException if database IO error occurs
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/module/ModuleDB.java