private Set<String> getUuids(final DataSource dataSource,
                                 final String sql,
                                 final String colName,
                                 final String name) {
        return DbUtil.getWithPreparedStatement(dataSource, sql, ThrowingFunction.unchecked(prepStmt -> {
            final ResultSet resultSet = prepStmt.executeQuery();
            final Set<String> uuids = new HashSet<>();
            while (resultSet.next()) {
                uuids.add(resultSet.getString(colName));
            }
            LOGGER.info("Found {} {} UUIDs", uuids.size(), name);
            return uuids;
        }));
    }
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