Cakephpで、migrationを実行する際に
Status Migration ID Migration Name
up 20190820105548 Initial
down 20190820110010 CreateComments
このCreateCommentsを「down」から「up」にする方法を知りたいです。
試したことは「bin/cake migrations migrate」で、これを実行しても赤文字のエラーがたくさん出ていて何が原因かわかりかねる状況です。
エラー内容は以下の通りです。
『exception 'PDOException' with message 'SQLSTATE[42000]: Syntax error or access violation: 1166 Incorrect column name ''' in /home/vagrant/cakephp_lessons/myblog/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/PdoAdapter.php:167
Stack trace:
#0 /home/vagrant/cakephp_lessons/myblog/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/PdoAdapter.php(167): PDO->exec('CREATE TABLE c...') #1 /home/vagrant/cakephp_lessons/myblog/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/MysqlAdapter.php(299): Phinx\Db\Adapter\PdoAdapter->execute('CREATE TABLE
c...')
#2 /home/vagrant/cakephp_lessons/myblog/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/AdapterWrapper.php(369): Phinx\Db\Adapter\MysqlAdapter->createTable(Object(Phinx\Db\Table\Table), Array, Array)
#3 /home/vagrant/cakephp_lessons/myblog/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/TimedOutputAdapter.php(138): Phinx\Db\Adapter\AdapterWrapper->createTable(Object(Phinx\Db\Table\Table), Array, Array)
#4 /home/vagrant/cakephp_lessons/myblog/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/AdapterWrapper.php(369): Phinx\Db\Adapter\TimedOutputAdapter->createTable(Object(Phinx\Db\Table\Table), Array, Array)
#5 /home/vagrant/cakephp_lessons/myblog/vendor/robmorgan/phinx/src/Phinx/Db/Plan/Plan.php(140): Phinx\Db\Adapter\AdapterWrapper->createTable(Object(Phinx\Db\Table\Table), Array, Array)
#6 /home/vagrant/cakephp_lessons/myblog/vendor/robmorgan/phinx/src/Phinx/Db/Table.php(719): Phinx\Db\Plan\Plan->execute(Object(Migrations\CakeAdapter))
#7 /home/vagrant/cakephp_lessons/myblog/vendor/robmorgan/phinx/src/Phinx/Db/Table.php(613): Phinx\Db\Table->executeActions(false)
#8 /home/vagrant/cakephp_lessons/myblog/vendor/cakephp/migrations/src/Table.php(118): Phinx\Db\Table->create()
#9 /home/vagrant/cakephp_lessons/myblog/config/Migrations/20190820110010_CreateComments.php(39): Migrations\Table->create()
#10 /home/vagrant/cakephp_lessons/myblog/vendor/robmorgan/phinx/src/Phinx/Migration/Manager/Environment.php(125): CreateComments->change()
#11 /home/vagrant/cakephp_lessons/myblog/vendor/robmorgan/phinx/src/Phinx/Migration/Manager.php(391): Phinx\Migration\Manager\Environment->executeMigration(Object(CreateComments), 'up', false)
#12 /home/vagrant/cakephp_lessons/myblog/vendor/robmorgan/phinx/src/Phinx/Migration/Manager.php(365): Phinx\Migration\Manager->executeMigration('default', Object(CreateComments), 'up', false)
#13 /home/vagrant/cakephp_lessons/myblog/vendor/robmorgan/phinx/src/Phinx/Console/Command/Migrate.php(122): Phinx\Migration\Manager->migrate('default', '20190820110010', false)
#14 /home/vagrant/cakephp_lessons/myblog/vendor/cakephp/migrations/src/Command/CommandTrait.php(35): Phinx\Console\Command\Migrate->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#15 /home/vagrant/cakephp_lessons/myblog/vendor/cakephp/migrations/src/Command/Migrate.php(67): Migrations\Command\Migrate->parentExecute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#16 /home/vagrant/cakephp_lessons/myblog/vendor/symfony/console/Command/Command.php(255): Migrations\Command\Migrate->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#17 /home/vagrant/cakephp_lessons/myblog/vendor/symfony/console/Application.php(969): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#18 /home/vagrant/cakephp_lessons/myblog/vendor/symfony/console/Application.php(255): Symfony\Component\Console\Application->doRunCommand(Object(Migrations\Command\Migrate), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#19 /home/vagrant/cakephp_lessons/myblog/vendor/symfony/console/Application.php(148): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#20 /home/vagrant/cakephp_lessons/myblog/vendor/cakephp/migrations/src/Shell/MigrationsShell.php(109): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#21 /home/vagrant/cakephp_lessons/myblog/vendor/cakephp/cakephp/src/Console/Shell.php(532): Migrations\Shell\MigrationsShell->main('migrations', 'migrate')
#22 /home/vagrant/cakephp_lessons/myblog/vendor/cakephp/migrations/src/Shell/MigrationsShell.php(165): Cake\Console\Shell->runCommand(Array, true, Array)
#23 /home/vagrant/cakephp_lessons/myblog/vendor/cakephp/cakephp/src/Console/CommandRunner.php(384): Migrations\Shell\MigrationsShell->runCommand(Array, true)
#24 /home/vagrant/cakephp_lessons/myblog/vendor/cakephp/cakephp/src/Console/CommandRunner.php(162): Cake\Console\CommandRunner->runShell(Object(Migrations\Shell\MigrationsShell), Array)
#25 /home/vagrant/cakephp_lessons/myblog/bin/cake.php(12): Cake\Console\CommandRunner->run(Array)
#26 {main}
』
何か少しでも手掛かりがわかる方、アドレスよろしくお願いします。
あなたの回答
tips
プレビュー