|
|
@ -144,7 +144,8 @@ class MigrateController extends Controller |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public function actionUp($limit = 0) |
|
|
|
public function actionUp($limit = 0) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (($migrations = $this->getNewMigrations()) === array()) { |
|
|
|
$migrations = $this->getNewMigrations(); |
|
|
|
|
|
|
|
if (empty($migrations)) { |
|
|
|
echo "No new migration found. Your system is up-to-date.\n"; |
|
|
|
echo "No new migration found. Your system is up-to-date.\n"; |
|
|
|
Yii::$app->end(); |
|
|
|
Yii::$app->end(); |
|
|
|
} |
|
|
|
} |
|
|
@ -198,7 +199,8 @@ class MigrateController extends Controller |
|
|
|
throw new Exception("The step argument must be greater than 0."); |
|
|
|
throw new Exception("The step argument must be greater than 0."); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (($migrations = $this->getMigrationHistory($limit)) === array()) { |
|
|
|
$migrations = $this->getMigrationHistory($limit); |
|
|
|
|
|
|
|
if (empty($migrations)) { |
|
|
|
echo "No migration has been done before.\n"; |
|
|
|
echo "No migration has been done before.\n"; |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
@ -244,7 +246,8 @@ class MigrateController extends Controller |
|
|
|
throw new Exception("The step argument must be greater than 0."); |
|
|
|
throw new Exception("The step argument must be greater than 0."); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (($migrations = $this->getMigrationHistory($limit)) === array()) { |
|
|
|
$migrations = $this->getMigrationHistory($limit); |
|
|
|
|
|
|
|
if (empty($migrations)) { |
|
|
|
echo "No migration has been done before.\n"; |
|
|
|
echo "No migration has been done before.\n"; |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
@ -407,7 +410,7 @@ class MigrateController extends Controller |
|
|
|
{ |
|
|
|
{ |
|
|
|
$limit = (int)$limit; |
|
|
|
$limit = (int)$limit; |
|
|
|
$migrations = $this->getMigrationHistory($limit); |
|
|
|
$migrations = $this->getMigrationHistory($limit); |
|
|
|
if ($migrations === array()) { |
|
|
|
if (empty($migrations)) { |
|
|
|
echo "No migration has been done before.\n"; |
|
|
|
echo "No migration has been done before.\n"; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
$n = count($migrations); |
|
|
|
$n = count($migrations); |
|
|
@ -441,7 +444,7 @@ class MigrateController extends Controller |
|
|
|
{ |
|
|
|
{ |
|
|
|
$limit = (int)$limit; |
|
|
|
$limit = (int)$limit; |
|
|
|
$migrations = $this->getNewMigrations(); |
|
|
|
$migrations = $this->getNewMigrations(); |
|
|
|
if ($migrations === array()) { |
|
|
|
if (empty($migrations)) { |
|
|
|
echo "No new migrations found. Your system is up-to-date.\n"; |
|
|
|
echo "No new migrations found. Your system is up-to-date.\n"; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
$n = count($migrations); |
|
|
|
$n = count($migrations); |
|
|
|