Commit 5f210189 by Alexander Kochetov

MigrateCommand enhancement. `all` option added for `down` action.

parent 10af7f05
...@@ -203,7 +203,13 @@ class MigrateController extends Controller ...@@ -203,7 +203,13 @@ class MigrateController extends Controller
*/ */
public function actionDown($limit = 1) public function actionDown($limit = 1)
{ {
if ($limit === 'all') {
$query = new Query;
$limit = $query->from($this->migrationTable)->count();
} 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.");
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment