class StepListPreparationsMigration implements BaseUpgradeTaskTo_2_1_0_PE {

    @Override
    public void run() {
        LOGGER.info("Migration of step ids in preparation...");

        preparationRepository
                .list(PersistentPreparation.class) //
                .forEach(p -> {
                    LOGGER.info("Migration of preparation #{}", p.getId());
                    final List<String> stepsIds = preparationUtils.listStepsIds(p.getHeadId(), preparationRepository);
                    p.setSteps(stepsIds);

                    preparationRepository.add(p);
                    LOGGER.info("Migration of preparation #{} done ({} steps)", p.getId(), stepsIds.size());
                });
        LOGGER.info("Migration of step ids in preparation done.");
    }

}