@Override
    public void migrate(final Context context) throws Exception {


        // *************************************************************************
        // Changing this migration to do nothing as it is not safe to run long term
        // as we can't be sure what state the four modules are in and whether
        // the tables exist or have changed since this was written.
        // Also, it is a bit moot as all the perms tables were migrated in v7.6
        // *************************************************************************


//        LOGGER.info("Starting purge of orphaned document permissions");
//        final DurationTimer timer = DurationTimer.start();
//
//        // Create the empty backup table
//        final boolean doesBackupTblExist = DbUtil.doesTableExist(
//                securityDbConnProvider.getConnection(), BACKUP_TBL_NAME);
//        LOGGER.info("doesBackupTblExist: {}", doesBackupTblExist);
//
//        if (!doesBackupTblExist) {
//            // Find all the doc uuids that are in use as docs, folders, proc filters and System
//            final Set<String> validDocUuids = getValidDocUuids();
//
//            LOGGER.info("Creating empty backup table {}", BACKUP_TBL_NAME);
//            DbUtil.executeStatement(securityDbConnProvider, String.format("""
//                    create table %s (primary key (id)) as
//                    select *
//                    from doc_permission
//                    where 1 = 0""", BACKUP_TBL_NAME));
//            doMigration(validDocUuids, timer);
//        } else {
//            LOGGER.info("Table {} already exists, nothing to do", BACKUP_TBL_NAME);
//        }
    }
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