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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrations no longer work on cake 3.0 #167

Closed
Spriz opened this Issue Dec 10, 2015 · 12 comments

Comments

Projects
None yet
4 participants
@Spriz

Spriz commented Dec 10, 2015

Hi!

Don't know if this is on purpose - but if it is, I think it should be stated somewhere! 馃槃

On CakePHP 3.0 highest version of migrations supported is 1.3.1 - where as 3.1 does upgrade to cakephp/migrations 1.5.1 and sphinx 0.5.0

I see that that from 1.4 (https://github.com/cakephp/migrations/releases/tag/1.4) cakephp/migrations required 3.1 - so if it's just the way it is, then I think it should clearly be stated somewhere, or are we the only ones running 3.0.x

@josegonzalez

This comment has been minimized.

Member

josegonzalez commented Dec 10, 2015

What exactly happens when you say "they no longer work"?

@Spriz

This comment has been minimized.

Spriz commented Dec 10, 2015

Error messages:

bin/cake migrations create TestMigration

$ bin/cake migrations create TestMigration

Welcome to CakePHP v3.0.15 Console
---------------------------------------------------------------
App : src
Path: /var/www/dev/apacta-2/src/
---------------------------------------------------------------
using migration path /var/www/dev/apacta-2/config/Migrations
PHP Fatal error:  Declaration of Migrations\CakeAdapter::insert() must be compatible with Phinx\Db\Adapter\AdapterInterface::insert(Phinx\Db\Table $table, $row) in /var/www/dev/apacta-2/vendor/cakephp/migrations/src/CakeAdapter.php on line 28
PHP Stack trace:
PHP   1. {main}() /var/www/dev/apacta-2/bin/cake.php:0
PHP   2. Cake\Console\ShellDispatcher::run() /var/www/dev/apacta-2/bin/cake.php:20
PHP   3. Cake\Console\ShellDispatcher->dispatch() /var/www/dev/apacta-2/vendor/cakephp/cakephp/src/Console/ShellDispatcher.php:125
PHP   4. Cake\Console\ShellDispatcher->_dispatch() /var/www/dev/apacta-2/vendor/cakephp/cakephp/src/Console/ShellDispatcher.php:174
PHP   5. Migrations\Shell\MigrationsShell->runCommand() /var/www/dev/apacta-2/vendor/cakephp/cakephp/src/Console/ShellDispatcher.php:203
PHP   6. Cake\Console\Shell->runCommand() /var/www/dev/apacta-2/vendor/cakephp/migrations/src/Shell/MigrationsShell.php:95
PHP   7. call_user_func_array:{/var/www/dev/apacta-2/vendor/cakephp/cakephp/src/Console/Shell.php:390}() /var/www/dev/apacta-2/vendor/cakephp/cakephp/src/Console/Shell.php:390
PHP   8. Migrations\Shell\MigrationsShell->main() /var/www/dev/apacta-2/vendor/cakephp/cakephp/src/Console/Shell.php:390
PHP   9. Symfony\Component\Console\Application->run() /var/www/dev/apacta-2/vendor/cakephp/migrations/src/Shell/MigrationsShell.php:82
PHP  10. Symfony\Component\Console\Application->doRun() /var/www/dev/apacta-2/vendor/symfony/console/Application.php:123
PHP  11. Symfony\Component\Console\Application->doRunCommand() /var/www/dev/apacta-2/vendor/symfony/console/Application.php:192
PHP  12. Symfony\Component\Console\Command\Command->run() /var/www/dev/apacta-2/vendor/symfony/console/Application.php:841
PHP  13. Migrations\Command\Create->execute() /var/www/dev/apacta-2/vendor/symfony/console/Command/Command.php:259
PHP  14. Phinx\Console\Command\Create->execute() /var/www/dev/apacta-2/vendor/cakephp/migrations/src/ConfigurationTrait.php:156
PHP  15. Migrations\Command\Create->bootstrap() /var/www/dev/apacta-2/vendor/robmorgan/phinx/src/Phinx/Console/Command/Create.php:92
PHP  16. spl_autoload_call() /var/www/dev/apacta-2/vendor/robmorgan/phinx/src/Phinx/Console/Command/Create.php:210
PHP  17. Composer\Autoload\ClassLoader->loadClass() /var/www/dev/apacta-2/vendor/robmorgan/phinx/src/Phinx/Console/Command/Create.php:210
PHP  18. Composer\Autoload\includeFile() /var/www/dev/apacta-2/vendor/composer/ClassLoader.php:301
PHP  19. include() /var/www/dev/apacta-2/vendor/composer/ClassLoader.php:412

Fatal error: Declaration of Migrations\CakeAdapter::insert() must be compatible with Phinx\Db\Adapter\AdapterInterface::insert(Phinx\Db\Table $table, $row) in /var/www/dev/apacta-2/vendor/cakephp/migrations/src/CakeAdapter.php on line 28

Call Stack:
    0.0001     222704   1. {main}() /var/www/dev/apacta-2/bin/cake.php:0
    0.1105    6305064   2. Cake\Console\ShellDispatcher::run() /var/www/dev/apacta-2/bin/cake.php:20
    0.1266    6960520   3. Cake\Console\ShellDispatcher->dispatch() /var/www/dev/apacta-2/vendor/cakephp/cakephp/src/Console/ShellDispatcher.php:125
    0.1266    6960680   4. Cake\Console\ShellDispatcher->_dispatch() /var/www/dev/apacta-2/vendor/cakephp/cakephp/src/Console/ShellDispatcher.php:174
    0.1277    7012576   5. Migrations\Shell\MigrationsShell->runCommand() /var/www/dev/apacta-2/vendor/cakephp/cakephp/src/Console/ShellDispatcher.php:203
    0.1277    7014104   6. Cake\Console\Shell->runCommand() /var/www/dev/apacta-2/vendor/cakephp/migrations/src/Shell/MigrationsShell.php:95
    0.1309    7202288   7. call_user_func_array:{/var/www/dev/apacta-2/vendor/cakephp/cakephp/src/Console/Shell.php:390}() /var/www/dev/apacta-2/vendor/cakephp/cakephp/src/Console/Shell.php:390
    0.1309    7202880   8. Migrations\Shell\MigrationsShell->main() /var/www/dev/apacta-2/vendor/cakephp/cakephp/src/Console/Shell.php:390
    0.1519    9393560   9. Symfony\Component\Console\Application->run() /var/www/dev/apacta-2/vendor/cakephp/migrations/src/Shell/MigrationsShell.php:82
    0.1559    9639432  10. Symfony\Component\Console\Application->doRun() /var/www/dev/apacta-2/vendor/symfony/console/Application.php:123
    0.1560    9640416  11. Symfony\Component\Console\Application->doRunCommand() /var/www/dev/apacta-2/vendor/symfony/console/Application.php:192
    0.1560    9640992  12. Symfony\Component\Console\Command\Command->run() /var/www/dev/apacta-2/vendor/symfony/console/Application.php:841
    0.1570    9645360  13. Migrations\Command\Create->execute() /var/www/dev/apacta-2/vendor/symfony/console/Command/Command.php:259
    0.1571    9647440  14. Phinx\Console\Command\Create->execute() /var/www/dev/apacta-2/vendor/cakephp/migrations/src/ConfigurationTrait.php:156
    0.1571    9647664  15. Migrations\Command\Create->bootstrap() /var/www/dev/apacta-2/vendor/robmorgan/phinx/src/Phinx/Console/Command/Create.php:92
    0.1709   10809480  16. spl_autoload_call() /var/www/dev/apacta-2/vendor/robmorgan/phinx/src/Phinx/Console/Command/Create.php:210
    0.1709   10809520  17. Composer\Autoload\ClassLoader->loadClass() /var/www/dev/apacta-2/vendor/robmorgan/phinx/src/Phinx/Console/Command/Create.php:210
    0.1710   10809656  18. Composer\Autoload\includeFile() /var/www/dev/apacta-2/vendor/composer/ClassLoader.php:301
    0.1717   10903872  19. include('/var/www/dev/apacta-2/vendor/cakephp/migrations/src/CakeAdapter.php') /var/www/dev/apacta-2/vendor/composer/ClassLoader.php:412

vendor/bin/phinx create TestMigration

$ vendor/bin/phinx create TestMigration
Phinx by Rob Morgan - https://phinx.org. version 0.5.0




  [InvalidArgumentException]
  The file "phinx.yml" does not exist (in: /var/www/dev/apacta-2, /var/www/dev/apacta-2/).



create [-c|--configuration CONFIGURATION] [-p|--parser PARSER] [-t|--template TEMPLATE] [-l|--class CLASS] [--] <name>

bin/cake bake migration AddTestTable id:uuid name:string

$ bin/cake bake migration AddTestTable id:uuid name:string

Welcome to CakePHP v3.0.15 Console
---------------------------------------------------------------
App : src
Path: /var/www/dev/apacta-2/src/
---------------------------------------------------------------
PHP Fatal error:  Class 'Phinx\Migration\Util' not found in /var/www/dev/apacta-2/vendor/cakephp/migrations/src/Shell/Task/SimpleMigrationTask.php on line 48
PHP Stack trace:
PHP   1. {main}() /var/www/dev/apacta-2/bin/cake.php:0
PHP   2. Cake\Console\ShellDispatcher::run() /var/www/dev/apacta-2/bin/cake.php:20
PHP   3. Cake\Console\ShellDispatcher->dispatch() /var/www/dev/apacta-2/vendor/cakephp/cakephp/src/Console/ShellDispatcher.php:125
PHP   4. Cake\Console\ShellDispatcher->_dispatch() /var/www/dev/apacta-2/vendor/cakephp/cakephp/src/Console/ShellDispatcher.php:174
PHP   5. Cake\Console\Shell->runCommand() /var/www/dev/apacta-2/vendor/cakephp/cakephp/src/Console/ShellDispatcher.php:203
PHP   6. Cake\Console\Shell->runCommand() /var/www/dev/apacta-2/vendor/cakephp/cakephp/src/Console/Shell.php:385
PHP   7. call_user_func_array:{/var/www/dev/apacta-2/vendor/cakephp/cakephp/src/Console/Shell.php:390}() /var/www/dev/apacta-2/vendor/cakephp/cakephp/src/Console/Shell.php:390
PHP   8. Bake\Shell\Task\SimpleBakeTask->main() /var/www/dev/apacta-2/vendor/cakephp/cakephp/src/Console/Shell.php:390
PHP   9. Migrations\Shell\Task\MigrationTask->bake() /var/www/dev/apacta-2/vendor/cakephp/bake/src/Shell/Task/SimpleBakeTask.php:85
PHP  10. Migrations\Shell\Task\SimpleMigrationTask->bake() /var/www/dev/apacta-2/vendor/cakephp/migrations/src/Shell/Task/MigrationTask.php:37
PHP  11. Bake\Shell\Task\SimpleBakeTask->bake() /var/www/dev/apacta-2/vendor/cakephp/migrations/src/Shell/Task/SimpleMigrationTask.php:69
PHP  12. Migrations\Shell\Task\SimpleMigrationTask->fileName() /var/www/dev/apacta-2/vendor/cakephp/bake/src/Shell/Task/SimpleBakeTask.php:101

Fatal error: Class 'Phinx\Migration\Util' not found in /var/www/dev/apacta-2/vendor/cakephp/migrations/src/Shell/Task/SimpleMigrationTask.php on line 48

Call Stack:
    0.0001     223040   1. {main}() /var/www/dev/apacta-2/bin/cake.php:0
    0.0578    6227560   2. Cake\Console\ShellDispatcher::run() /var/www/dev/apacta-2/bin/cake.php:20
    0.0656    6883920   3. Cake\Console\ShellDispatcher->dispatch() /var/www/dev/apacta-2/vendor/cakephp/cakephp/src/Console/ShellDispatcher.php:125
    0.0656    6884080   4. Cake\Console\ShellDispatcher->_dispatch() /var/www/dev/apacta-2/vendor/cakephp/cakephp/src/Console/ShellDispatcher.php:174
    0.0798    9004112   5. Cake\Console\Shell->runCommand() /var/www/dev/apacta-2/vendor/cakephp/cakephp/src/Console/ShellDispatcher.php:203
    0.0908    9470160   6. Cake\Console\Shell->runCommand() /var/www/dev/apacta-2/vendor/cakephp/cakephp/src/Console/Shell.php:385
    0.0912    9480440   7. call_user_func_array:{/var/www/dev/apacta-2/vendor/cakephp/cakephp/src/Console/Shell.php:390}() /var/www/dev/apacta-2/vendor/cakephp/cakephp/src/Console/Shell.php:390
    0.0912    9480608   8. Bake\Shell\Task\SimpleBakeTask->main() /var/www/dev/apacta-2/vendor/cakephp/cakephp/src/Console/Shell.php:390
    0.0912    9480888   9. Migrations\Shell\Task\MigrationTask->bake() /var/www/dev/apacta-2/vendor/cakephp/bake/src/Shell/Task/SimpleBakeTask.php:85
    0.0912    9482320  10. Migrations\Shell\Task\SimpleMigrationTask->bake() /var/www/dev/apacta-2/vendor/cakephp/migrations/src/Shell/Task/MigrationTask.php:37
    0.0912    9482688  11. Bake\Shell\Task\SimpleBakeTask->bake() /var/www/dev/apacta-2/vendor/cakephp/migrations/src/Shell/Task/SimpleMigrationTask.php:69
    0.1113   10469768  12. Migrations\Shell\Task\SimpleMigrationTask->fileName() /var/www/dev/apacta-2/vendor/cakephp/bake/src/Shell/Task/SimpleBakeTask.php:101
@Spriz

This comment has been minimized.

Spriz commented Dec 10, 2015

Sorry @josegonzalez - you beat me to it 馃槃 Error messages above.

@Spriz

This comment has been minimized.

Spriz commented Dec 10, 2015

I think it could be resolved if the latest cake 3.0 compatible version of migrations didn't use "robmorgan/phinx": "dev-master" in the composer.json - but rather last compatible version.

@josegonzalez

This comment has been minimized.

Member

josegonzalez commented Dec 10, 2015

That's part of your composer.json. I think we assume all new projects won't be using old versions of the cakephp/app repo, and thus will get new stuff.

We definitely should call out the robmorgan/phinx issue in the readme though...

@Spriz

This comment has been minimized.

Spriz commented Dec 10, 2015

Nope, @josegonzalez that's from the composer.son from cakephp/migrations

If I add "robmorgan/phinx": "0.4.*", to my personal composer.json it works though :)

I guess that's until cakephp/migrations require phinx 0.5.*

@HavokInspiration

This comment has been minimized.

Member

HavokInspiration commented Dec 10, 2015

What about doing a 1.3.2 release with max requirement being the last release of Cake 3.0.X and putting it back to 0.4.X for phinx ?

Note however that the test suite will not pass and more importantly, if using SQLite and doing specific operations (related to indexes), this can lead to table drops.

@lorenzo

This comment has been minimized.

Member

lorenzo commented Dec 10, 2015

Cake 3.0 is only receiving security patches. Please upgrade to cakephp 3.1

@Spriz

This comment has been minimized.

Spriz commented Dec 10, 2015

Allrighty :-)

@Spriz Spriz closed this Dec 10, 2015

@josegonzalez

This comment has been minimized.

Member

josegonzalez commented Dec 10, 2015

@HavokInspiration 馃憤 , just be sure to mention that in the readme/release notes.

@HavokInspiration

This comment has been minimized.

Member

HavokInspiration commented Dec 10, 2015

Reopening so I don't forget

@HavokInspiration

This comment has been minimized.

Member

HavokInspiration commented Dec 16, 2015

Hey @Spriz.
A new version 1.3.2 was just released. Max requirements is for Cake 3.0.X and phinx 0.4.X.
It should now work with a 3.0.X release.

@HavokInspiration HavokInspiration added this to the 1.3.2 milestone Dec 16, 2015

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