1
0
Fork 0
mirror of https://github.com/Oreolek/kohana-migrations.git synced 2024-06-26 03:40:54 +03:00

Adding db:status to report the status of migrations that have been run

This commit is contained in:
Matt Button 2011-01-20 23:57:03 +00:00
parent f4538e6713
commit eb907da7f4
2 changed files with 32 additions and 0 deletions

View file

@ -0,0 +1,28 @@
<?php
/**
* Displays the current status of migrations in all locations
*
* This task takes no config options
*
* @author Matt Button <matthew@sigswitch.com>
*/
class Minion_Task_Db_Status extends Minion_Task {
/**
* Execute the task
*
* @param array Config for the task
*/
public function execute(array $config)
{
$db = Database::instance();
$model = new Model_Minion_Migration($db);
$view = new View('minion/task/db/status');
$view->locations = $model->get_location_statuses();
echo $view;
}
}

View file

@ -0,0 +1,4 @@
<?php foreach($locations as $location => $status): ?>
* <?php echo $location ?> <?php echo ($status !== NULL ? $status : 'Not installed'); ?>
<?php endforeach; ?>