MigrateController refactoring

This commit is contained in:
Alexander Kochetov
2014-05-14 13:22:04 +04:00
parent e08473a082
commit f5b7788edd

View File

@ -205,15 +205,13 @@ class MigrateController extends Controller
public function actionDown($limit = 1)
{
if ($limit === 'all') {
$query = new Query;
$limit = $query->from($this->migrationTable)->count();
$limit = null;
} else {
$limit = (int) $limit;
}
if ($limit < 1) {
throw new Exception("The step argument must be greater than 0.");
}
}
$migrations = $this->getMigrationHistory($limit);
if (empty($migrations)) {