Neos.ContentRepository/Classes/Migration/Command/NodeCommandController.php
public function migrationStatusCommand()
    {
        $this->outputLine();

        $availableMigrations = $this->migrationFactory->getAvailableMigrationsForCurrentConfigurationType();
        if (count($availableMigrations) === 0) {
            $this->outputLine('No migrations available.');
            $this->quit();
        }

        $appliedMigrations = $this->migrationStatusRepository->findAll();
        $appliedMigrationsDictionary = [];
        /** @var $appliedMigration MigrationStatus */
        foreach ($appliedMigrations as $appliedMigration) {
            $appliedMigrationsDictionary[$appliedMigration->getVersion()][] = $appliedMigration;
        }

        $tableRows = [];
        foreach ($availableMigrations as $version => $migration) {
            $migrationUpConfigurationComments = $this->migrationFactory->getMigrationForVersion($version)->getUpConfiguration()->getComments();

            if (isset($appliedMigrationsDictionary[$version])) {
                $applicationInformation = $this->phraseMigrationApplicationInformation($appliedMigrationsDictionary[$version]);
                if ($applicationInformation !== '') {
                    $migrationUpConfigurationComments .= PHP_EOL . '<b>Applied:</b>' . PHP_EOL . $applicationInformation;
                }
            }

            $tableRows[] = [
                $version,
                $migration['formattedVersionNumber'],
                $migration['package']->getPackageKey(),
                wordwrap($migrationUpConfigurationComments, 60)
            ];
        }

        $this->outputLine('<b>Available migrations</b>');
        $this->outputLine();
        $this->output->outputTable($tableRows, ['Version', 'Date', 'Package', 'Comments']);
    }
public function migrationStatusCommand()
    {
        $this->outputLine();

        $availableMigrations = $this->migrationFactory->getAvailableMigrationsForCurrentConfigurationType();
        if (count($availableMigrations) === 0) {
            $this->outputLine('No migrations available.');
            $this->quit();
        }

        $appliedMigrations = $this->migrationStatusRepository->findAll();
        $appliedMigrationsDictionary = [];
        /** @var $appliedMigration MigrationStatus */
        foreach ($appliedMigrations as $appliedMigration) {
            $appliedMigrationsDictionary[$appliedMigration->getVersion()][] = $appliedMigration;
        }

        $tableRows = [];
        foreach ($availableMigrations as $version => $migration) {
            $migrationUpConfigurationComments = $this->migrationFactory->getMigrationForVersion($version)->getUpConfiguration()->getComments();

            if (isset($appliedMigrationsDictionary[$version])) {
                $applicationInformation = $this->phraseMigrationApplicationInformation($appliedMigrationsDictionary[$version]);
                if ($applicationInformation !== '') {
                    $migrationUpConfigurationComments .= PHP_EOL . '<b>Applied:</b>' . PHP_EOL . $applicationInformation;
                }
            }

            $tableRows[] = [
                $version,
                $migration['formattedVersionNumber'],
                $migration['package']->getPackageKey(),
                wordwrap($migrationUpConfigurationComments, 60)
            ];
        }

        $this->outputLine('<b>Available migrations</b>');
        $this->outputLine();
        $this->output->outputTable($tableRows, ['Version', 'Date', 'Package', 'Comments']);
    }
public function migrationStatusCommand ( ) { $ this -> outputLine ( ) ; $ availableMigrations = $ this -> migrationFactory -> getAvailableMigrationsForCurrentConfigurationType ( ) ; if ( count ( $ availableMigrations ) === 0 ) { $ this -> outputLine ( 'No migrations available.' ) ; $ this -> quit ( ) ; } $ appliedMigrations = $ this -> migrationStatusRepository -> findAll ( ) ; $ appliedMigrationsDictionary = [ ] ; /** @var $appliedMigration MigrationStatus */ foreach ( $ appliedMigrations as $ appliedMigration ) { $ appliedMigrationsDictionary [ $ appliedMigration -> getVersion ( ) ] [ ] = $ appliedMigration ; } $ tableRows = [ ] ; foreach ( $ availableMigrations as $ version => $ migration ) { $ migrationUpConfigurationComments = $ this -> migrationFactory -> getMigrationForVersion ( $ version ) -> getUpConfiguration ( ) -> getComments ( ) ; if ( isset ( $ appliedMigrationsDictionary [ $ version ] ) ) { $ applicationInformation = $ this -> phraseMigrationApplicationInformation ( $ appliedMigrationsDictionary [ $ version ] ) ; if ( $ applicationInformation !== '' ) { $ migrationUpConfigurationComments .= PHP_EOL . '<b>Applied:</b>' . PHP_EOL . $ applicationInformation ; } } $ tableRows [ ] = [ $ version , $ migration [ 'formattedVersionNumber' ] , $ migration [ 'package' ] -> getPackageKey ( ) , wordwrap ( $ migrationUpConfigurationComments , 60 ) ] ; } $ this -> outputLine ( '<b>Available migrations</b>' ) ; $ this -> outputLine ( ) ; $ this -> output -> outputTable ( $ tableRows , [ 'Version' , 'Date' , 'Package' , 'Comments' ] ) ; }
List available and applied migrations

@return void
@see neos.contentrepository.migration:node:migrate
List available and applied migrations