protected function doRollback(Migrator $migrator, $target_group, $target_version)
    {
        $installed_migrations = $migrator->installedMigrationsByDesc();

        if (!isset($installed_migrations[$target_group])) {
            $this->info("Nothing migrations for group '$target_group'.");

            return;
        }

        foreach ($installed_migrations[$target_group] as $data) {
            // check version
            if ($migrator->compareMigrationVersion($data->version, $target_version) < 0) {
                continue;
            }

            $this->infoDowngrade($target_group, $data->version, $data->class);

            $migrator->doDowngrade($target_group, $data->version);
        }
    }