private static void clearAllTables(final Connection connection) {
        final List<String> tables = new ArrayList<>();

        try (final PreparedStatement statement = connection.prepareStatement(FIND_TABLES)) {
            try (final ResultSet resultSet = statement.executeQuery()) {
                while (resultSet.next()) {
                    final String name = resultSet.getString(1);
                    // `permission_doc_id` is a table of static reference values so leave it alone.
                    if (!"permission_doc_id".equalsIgnoreCase(name)) {
                        tables.add(name);
                    }
                }
            }
        } catch (final SQLException e) {
            throw new RuntimeException(e.getMessage(), e);
        }

        clearTables(connection, tables);
    }
@param dbConfig         The config to use
@param name             The name of the datasource, i.e. the module name
@param unique           True if we want our own dedicated connection pool
@param isSharedDatabase True if we want to re-use the DB between tests. We normally do
                        to save on the cost of running migrations, but not for
                        migration tests as for those we want a blank db.
stroom-test-common/src/main/java/stroom/test/common/util/db/DbTestUtil.java