/**
* Shows a list of available migrations
*
* @param array $mapping Migration mapping
* @param string $type Can be 'app' or a plugin name
* @return void
*/
protected function _showInfo($mapping, $type = null) {
if ($type === null) {
$type = $this->type;
}
$version = $this->Version->getVersion($type);
if ($version != 0) {
$info = $mapping[$version];
$this->out(__d('Migrations', 'Current migration version:'));
$this->out(' #' . number_format($version / 100, 2, '', '') . ' ' . $info['name']);
$this->hr();
}
$this->out(__d('Migrations', 'Available migrations:'));
foreach ($mapping as $version => $info) {
$this->out(' [' . number_format($version / 100, 2, '', '') . '] ' . $info['name']);
$this->out(' ', false);
if ($info['migrated'] !== null) {
$this->out(__d('Migrations', 'applied') . ' ' . date('r', strtotime($info['migrated'])));
} else {
$this->out(__d('Migrations', 'not applied'));
}
}
}