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:
parent
f4538e6713
commit
eb907da7f4
28
classes/minion/task/db/status.php
Normal file
28
classes/minion/task/db/status.php
Normal 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;
|
||||
}
|
||||
}
|
4
views/minion/task/db/status.php
Normal file
4
views/minion/task/db/status.php
Normal file
|
@ -0,0 +1,4 @@
|
|||
<?php foreach($locations as $location => $status): ?>
|
||||
* <?php echo $location ?> <?php echo ($status !== NULL ? $status : 'Not installed'); ?>
|
||||
|
||||
<?php endforeach; ?>
|
Loading…
Reference in a new issue