Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate fails since latest update of yii2 ? #19

Closed
philippfrenzel opened this issue Jan 9, 2017 · 8 comments
Closed

Migrate fails since latest update of yii2 ? #19

philippfrenzel opened this issue Jan 9, 2017 · 8 comments

Comments

@philippfrenzel
Copy link

philippfrenzel commented Jan 9, 2017

Apply the above migrations? (yes|no) [no]:yes
*** applying m150127_040544_add_attachments
PHP Fatal error:  Class 'm150127_040544_add_attachments' not found in /app/vendor/dmstr/yii2-migrate-command/MigrateController.php on line 622
PHP Fatal Error 'yii\base\ErrorException' with message 'Class 'm150127_040544_add_attachments' not found'

in /app/vendor/dmstr/yii2-migrate-command/MigrateController.php:622

Stack trace:
#0 /app/vendor/dmstr/yii2-migrate-command/MigrateController.php(204): dmstr\console\controllers\MigrateController->migrateUp()
#1 /app/vendor/yiisoft/yii2/base/InlineAction.php(55): dmstr\console\controllers\MigrateController->actionUp()
#2 /app/vendor/yiisoft/yii2/base/InlineAction.php(55): ::call_user_func_array:{/app/vendor/yiisoft/yii2/base/InlineAction.php:55}()
#3 /app/vendor/yiisoft/yii2/base/Controller.php(154): yii\base\InlineAction->runWithParams()
#4 /app/vendor/yiisoft/yii2/console/Controller.php(128): yii\base\Controller->runAction()
#5 /app/vendor/yiisoft/yii2/base/Module.php(454): yii\console\Controller->runAction()
#6 /app/vendor/yiisoft/yii2/console/Application.php(180): yii\base\Module->runAction()
#7 /app/vendor/yiisoft/yii2/console/Application.php(147): yii\console\Application->runAction()
#8 /app/vendor/yiisoft/yii2/base/Application.php(375): yii\console\Application->handleRequest()
#9 /app/yii(27): yii\base\Application->run()
#10 {main}

[edit] formatting

@schmunk42
Copy link
Member

There were some updates in Yii, but could you double check if you really have that class with the correct class-, file- and alias-name.

@philippfrenzel
Copy link
Author

philippfrenzel commented Jan 9, 2017 via email

@schmunk42
Copy link
Member

Looks like it's because of the new alias support of migrations.

Our migrate command can not find it because this migration is not in the global namespace.
Don't have a quick solution for that at hand.

@philippfrenzel
Copy link
Author

Thanks for trying to get feedback from the yii2 core team - looks like they friendly say you have to adopt the module ... :)

@schmunk42
Copy link
Member

You might try running two separate migration steps as a quick workaround.

One with this command and the original Yii command for namespaced migrations.

@philippfrenzel
Copy link
Author

philippfrenzel commented Jan 9, 2017

'yiimigrate' => [ 'class' => 'yii\console\controllers\MigrateController', 'migrationNamespaces' => [ 'nemmo\attachments\migrations', ], ],

@schmunk42
Copy link
Member

Let's keep that open until it's completely resolved ;)

@schmunk42
Copy link
Member

schmunk42 commented Jan 10, 2017

81fecdf

You should get Yii 2.0.9 - if running the latest version with this extension now.
Depending on the outcome of the discussion in the Yii repo, we may update or deprecate this extension.

I think this one can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants