-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
Description
Lets say in our app we have a module (for example app/modules/admin
) with namespaced migrations and our own namespaced migrations.
In the app config we have this block:
'controllerMap' => [
'migrate' => [
'class' => 'yii\console\controllers\MigrateController',
'migrationNamespaces' => ['app\migrations'],
'migrationPath' => null, // disable all non-namespaced migrations
],
],
And applied migrations ordered by apply_time:
app\migrations\M161210195701CreateUserTable
app\migrations\M161210195702CreateProfileTable
app\modules\admin\migrations\M161210195703CreateAccessTable
app\modules\admin\migrations\M161210195704CreatePostTable
app\migrations\M161210195705CreateRoleTable
app\modules\admin\migrations\M161210195706AddSomeColumn
I expect the yii\console\controllers\MigrateController::getMigrationHistory()
method, that's used by migrate/history
and migrate/down
commands, will filter the applied migrations by the migration namespaces.
For example:
./yii migrate/history
(where migrationNamespaces
= ['app\migrations']
from the app config) should return only migrations from the app\migrations
namespace:
(datetime) app\migrations\M161210195701CreateUserTable
(datetime) app\migrations\M161210195702CreateProfileTable
(datetime) app\migrations\M161210195705CreateRoleTable
Whereas ./yii migrate/history --migrationNamespaces=app\modules\admin\migrations
should return only migrations from the module namespace:
(datetime) app\modules\admin\migrations\M161210195703CreateAccessTable
(datetime) app\modules\admin\migrations\M161210195704CreatePostTable
(datetime) app\modules\admin\migrations\M161210195706AddSomeColumn
Isn't that the expected behavior?