mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-10 23:50:38 +08:00
MigrateController refactoring
This commit is contained in:
@@ -205,15 +205,13 @@ class MigrateController extends Controller
|
|||||||
public function actionDown($limit = 1)
|
public function actionDown($limit = 1)
|
||||||
{
|
{
|
||||||
if ($limit === 'all') {
|
if ($limit === 'all') {
|
||||||
$query = new Query;
|
$limit = null;
|
||||||
$limit = $query->from($this->migrationTable)->count();
|
|
||||||
} else {
|
} else {
|
||||||
$limit = (int) $limit;
|
$limit = (int) $limit;
|
||||||
}
|
|
||||||
|
|
||||||
if ($limit < 1) {
|
if ($limit < 1) {
|
||||||
throw new Exception("The step argument must be greater than 0.");
|
throw new Exception("The step argument must be greater than 0.");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$migrations = $this->getMigrationHistory($limit);
|
$migrations = $this->getMigrationHistory($limit);
|
||||||
if (empty($migrations)) {
|
if (empty($migrations)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user