private Set<String> getValidDocUuids() {
        final Set<String> allFolderUuids = getAllFolderUuids();
        final Set<String> processorFilterUuids = getProcessorFilterUuids();
        final Set<String> docUuids = getDocUuids();
        // Should be same as ExplorerConstants.SYSTEM_DOC_REF.getUuid() when this mig was written

        final Set<String> validDocUuids = new HashSet<>(allFolderUuids.size()
                                                        + processorFilterUuids.size()
                                                        + docUuids.size()
                                                        + 1);
        validDocUuids.addAll(allFolderUuids);
        validDocUuids.addAll(processorFilterUuids);
        validDocUuids.addAll(docUuids);
        validDocUuids.add(SYSTEM_DOC_UUID);
        return validDocUuids;
    }
Previously deletion of a doc or proc_filter did not delete the doc_permission records for it.
This migration deletes any doc_permission records for a doc_uuid that cannot be found
in doc, processor_filter or explorer_node and is not the System doc (uuid == 0).
<p>
The migration copies the orphaned doc_permission records to a backup table
({@link V07_05_00_005__Orphaned_Doc_Perms#BACKUP_TBL_NAME}) before deleting them.
</p>
stroom-app/src/main/java/stroom/app/db/migration/V07_05_00_005__Orphaned_Doc_Perms.java