Yii2: Wrong migration history order

Created on 12 Nov 2016  路  6Comments  路  Source: yiisoft/yii2

console config:

'controllerMap' => [
    'migrate' => [
        'class' => 'yii\console\controllers\MigrateController',
        'migrationNamespaces' => [
            'app\migrations',
            'app\modules\mymodule\migrations',
        ],
        'migrationPath' => null,
    ],
],

apply some migrations:

app\migrations\M140506102106One
app\migrations\M160909083544Two
app\migrations\M160930135248Three
app\modules\mymodule\migrations\M161018124749Four
app\modules\mymodule\migrations\M161025123028Five
app\migrations\M161110133341Six

run ./yii migrate/history

Showing the last 6 applied migrations:
    (2016-11-12 16:53:04) app\migrations\M161110133341Six
    (2016-11-12 16:53:04) app\modules\mymodule\migrations\M161025123028Five
    (2016-11-12 16:53:03) app\modules\mymodule\migrations\M161018124749Four
    (2016-11-12 16:52:20) app\migrations\M160930135248Three
    (2016-11-12 16:52:17) app\migrations\M160909083544Two
    (2016-11-12 16:52:16) app\migrations\M140506102106One

then run ./yii migrate/history 1

What is the expected result?

Showing the last 1 applied migration:
    (2016-11-12 16:53:04) app\migrations\M161110133341Six

What do you get instead?

Showing the last 1 applied migration:
    (2016-11-12 16:53:04) app\modules\mymodule\migrations\M161025123028Five

Additional info

| Q | A
| ---------------- | ---
| Yii version | master
| PHP version | 7.0
| Operating system | Fedora 24

bug

Most helpful comment

Resolved by commit 1157657cab3c3ef867a5bd929b893e44f5f2dbcc

All 6 comments

@evgen-d would you like to fix this one?

@SilverFire i think that version and namespace must be on different columns of DB table, but this can break BC

We can fix it now without BC breaking and apply a BC-breaking change for 2.1.

Asking for @yiisoft/core-developers opinions.

It related to, but not the result of this issue

Resolved by commit 1157657cab3c3ef867a5bd929b893e44f5f2dbcc

Was this page helpful?
0 / 5 - 0 ratings